@wocker/core 1.0.20-dev.3 → 1.0.20-dev.5
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.
|
@@ -16,7 +16,7 @@ export declare class FileSystem {
|
|
|
16
16
|
writeFile(path: string, data: string | Buffer | NodeJS.ArrayBufferView, options?: fs.WriteFileOptions): Promise<void>;
|
|
17
17
|
writeJSON(path: string, data: any, options?: WriteFileOptions): void;
|
|
18
18
|
rm(path: string, options?: RmOptions): Promise<void>;
|
|
19
|
-
createWriteStream(path: string): fs.WriteStream;
|
|
20
|
-
createReadStream(path: string): fs.ReadStream;
|
|
19
|
+
createWriteStream(path: string, options?: BufferEncoding): fs.WriteStream;
|
|
20
|
+
createReadStream(path: string, options?: BufferEncoding): fs.ReadStream;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
package/lib/makes/FileSystem.js
CHANGED
|
@@ -64,13 +64,14 @@ class FileSystem {
|
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
const fullPath = this.path(...parts);
|
|
66
66
|
return new Promise((resolve, reject) => {
|
|
67
|
-
|
|
67
|
+
const callback = (err, files) => {
|
|
68
68
|
if (err) {
|
|
69
69
|
reject(err);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
resolve(files);
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
|
+
fs_1.default.readdir(fullPath, callback);
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
77
|
}
|
|
@@ -140,11 +141,11 @@ class FileSystem {
|
|
|
140
141
|
});
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
|
-
createWriteStream(path) {
|
|
144
|
-
return fs_1.default.createWriteStream(this.path(path));
|
|
144
|
+
createWriteStream(path, options) {
|
|
145
|
+
return fs_1.default.createWriteStream(this.path(path), options);
|
|
145
146
|
}
|
|
146
|
-
createReadStream(path) {
|
|
147
|
-
return fs_1.default.createReadStream(this.path(path));
|
|
147
|
+
createReadStream(path, options) {
|
|
148
|
+
return fs_1.default.createReadStream(this.path(path), options);
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
exports.FileSystem = FileSystem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wocker/core",
|
|
3
|
-
"version": "1.0.20-dev.
|
|
3
|
+
"version": "1.0.20-dev.5",
|
|
4
4
|
"author": "Kris Papercut <krispcut@gmail.com>",
|
|
5
5
|
"description": "Core of the Wocker",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test-watch": "jest --colors --watchAll --coverage"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@kearisp/cli": "^2.0.7
|
|
28
|
+
"@kearisp/cli": "^2.0.7",
|
|
29
29
|
"fs": "^0.0.1-security",
|
|
30
30
|
"path": "^0.12.7",
|
|
31
31
|
"reflect-metadata": "^0.2.2"
|