vscode-fs 0.0.7 → 0.0.8

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/dist/index.cjs CHANGED
@@ -342,6 +342,10 @@ async function createNodeFileSystem() {
342
342
  createWritableStream: async (uri) => {
343
343
  const writableStream = fs.createWriteStream(uri.fsPath);
344
344
  return stream.Writable.toWeb(writableStream);
345
+ },
346
+ createReadableStream: async (uri) => {
347
+ const readableStream = fs.createReadStream(uri.fsPath);
348
+ return stream.Readable.toWeb(readableStream);
345
349
  }
346
350
  };
347
351
  }
package/dist/index.d.cts CHANGED
@@ -239,6 +239,13 @@ interface FileSystem {
239
239
  * @returns A writer for the file.
240
240
  */
241
241
  createWritableStream(uri: URI): Promise<WritableStream<Uint8Array>>;
242
+ /**
243
+ * Create a readable stream for a file.
244
+ *
245
+ * @param uri The uri of the file to read from.
246
+ * @returns A readable stream for the file.
247
+ */
248
+ createReadableStream(uri: URI): Promise<ReadableStream<Uint8Array>>;
242
249
  }
243
250
  interface Disposable {
244
251
  /** Dispose resources. */
package/dist/index.d.mts CHANGED
@@ -239,6 +239,13 @@ interface FileSystem {
239
239
  * @returns A writer for the file.
240
240
  */
241
241
  createWritableStream(uri: URI): Promise<WritableStream<Uint8Array>>;
242
+ /**
243
+ * Create a readable stream for a file.
244
+ *
245
+ * @param uri The uri of the file to read from.
246
+ * @returns A readable stream for the file.
247
+ */
248
+ createReadableStream(uri: URI): Promise<ReadableStream<Uint8Array>>;
242
249
  }
243
250
  interface Disposable {
244
251
  /** Dispose resources. */
package/dist/index.mjs CHANGED
@@ -341,6 +341,10 @@ async function createNodeFileSystem() {
341
341
  createWritableStream: async (uri) => {
342
342
  const writableStream = fs.createWriteStream(uri.fsPath);
343
343
  return stream.Writable.toWeb(writableStream);
344
+ },
345
+ createReadableStream: async (uri) => {
346
+ const readableStream = fs.createReadStream(uri.fsPath);
347
+ return stream.Readable.toWeb(readableStream);
344
348
  }
345
349
  };
346
350
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vscode-fs",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "description": "VSCode like simple、serializable and cross-platform file system utilities.",
6
6
  "author": "Naily Zero <zero@naily.cc> (https://naily.cc)",
7
7
  "license": "MIT",