fake-node 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_fs.d.ts +254 -0
- package/lib/_fs.js +750 -0
- package/lib/_fs.js.map +1 -0
- package/lib/buffer.d.ts +9 -0
- package/lib/buffer.js +12 -0
- package/lib/buffer.js.map +1 -0
- package/lib/fs.d.ts +110 -0
- package/lib/fs.js +223 -0
- package/lib/fs.js.map +1 -0
- package/lib/index.d.ts +34 -13
- package/lib/index.js +113 -37
- package/lib/index.js.map +1 -0
- package/lib/os.js +3 -13
- package/lib/os.js.map +1 -0
- package/lib/path.d.ts +55 -0
- package/lib/path.js +105 -0
- package/lib/path.js.map +1 -0
- package/lib/process.js +2 -9
- package/lib/process.js.map +1 -0
- package/lib/querystring.js +1 -0
- package/lib/querystring.js.map +1 -0
- package/lib/util.d.ts +145 -0
- package/lib/util.js +460 -0
- package/lib/util.js.map +1 -0
- package/package.json +5 -2
- package/src/_fs.ts +852 -0
- package/src/buffer.ts +13 -0
- package/src/fs.ts +168 -455
- package/src/in_fake_node.d.ts +12 -0
- package/src/index.ts +134 -42
- package/src/os.ts +3 -10
- package/src/path.ts +141 -0
- package/src/process.ts +2 -20
- package/src/util.ts +126 -13
package/src/buffer.ts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
const Blob_ = Blob;
|
3
|
+
export {Blob_ as Blob};
|
4
|
+
|
5
|
+
export type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
|
6
|
+
|
7
|
+
export class Buffer extends Uint8Array {
|
8
|
+
|
9
|
+
toString(encoding: BufferEncoding = 'utf-8'): string {
|
10
|
+
return (new TextDecoder(encoding)).decode(this);
|
11
|
+
}
|
12
|
+
|
13
|
+
}
|