Comparing version 4.14.1 to 4.15.0
import type * as opts from './types/options'; | ||
import type { IFileHandle, IStats, TData, TDataOut, TMode, TTime } from './types/misc'; | ||
import type { IFileHandle, IReadStream, IWriteStream, IStats, TData, TDataOut, TMode, TTime } from './types/misc'; | ||
import type { FsCallbackApi } from './types'; | ||
@@ -13,2 +13,4 @@ export declare class FileHandle implements IFileHandle { | ||
datasync(): Promise<void>; | ||
createReadStream(options: opts.IFileHandleReadStreamOptions): IReadStream; | ||
createWriteStream(options: opts.IFileHandleWriteStreamOptions): IWriteStream; | ||
readableWebStream(options?: opts.IReadableWebStreamOptions): ReadableStream; | ||
@@ -15,0 +17,0 @@ read(buffer: Buffer | Uint8Array, offset: number, length: number, position: number): Promise<TFileHandleReadResult>; |
@@ -25,2 +25,8 @@ "use strict"; | ||
} | ||
createReadStream(options) { | ||
return this.fs.createReadStream('', Object.assign(Object.assign({}, options), { fd: this })); | ||
} | ||
createWriteStream(options) { | ||
return this.fs.createWriteStream('', Object.assign(Object.assign({}, options), { fd: this })); | ||
} | ||
readableWebStream(options) { | ||
@@ -27,0 +33,0 @@ return new ReadableStream({ |
@@ -5,3 +5,3 @@ import type { PathLike, symlink } from 'fs'; | ||
import type { TSetTimeout } from '../../setTimeoutUnref'; | ||
import type { IAppendFileOptions, IReadableWebStreamOptions, IReadFileOptions, IStatOptions, IWriteFileOptions } from './options'; | ||
import type { IAppendFileOptions, IFileHandleReadStreamOptions, IFileHandleWriteStreamOptions, IReadableWebStreamOptions, IReadFileOptions, IStatOptions, IWriteFileOptions } from './options'; | ||
import type { Readable, Writable } from 'stream'; | ||
@@ -119,2 +119,4 @@ export { PathLike, symlink }; | ||
close(): Promise<void>; | ||
createReadStream(options: IFileHandleReadStreamOptions): IReadStream; | ||
createWriteStream(options: IFileHandleWriteStreamOptions): IWriteStream; | ||
datasync(): Promise<void>; | ||
@@ -121,0 +123,0 @@ readableWebStream(options?: IReadableWebStreamOptions): ReadableStream; |
@@ -31,2 +31,20 @@ import type { IFileHandle, TEncodingExtended, TFlags, TMode } from './misc'; | ||
} | ||
export interface IFileHandleReadStreamOptions { | ||
encoding?: BufferEncoding; | ||
autoClose?: boolean; | ||
emitClose?: boolean; | ||
start?: number | undefined; | ||
end?: number; | ||
highWaterMark?: number; | ||
flush?: boolean; | ||
signal?: AbortSignal | undefined; | ||
} | ||
export interface IFileHandleWriteStreamOptions { | ||
encoding?: BufferEncoding; | ||
autoClose?: boolean; | ||
emitClose?: boolean; | ||
start?: number; | ||
highWaterMark?: number; | ||
flush?: boolean; | ||
} | ||
export interface IReaddirOptions extends IOptions { | ||
@@ -33,0 +51,0 @@ recursive?: boolean; |
{ | ||
"name": "memfs", | ||
"version": "4.14.1", | ||
"version": "4.15.0", | ||
"description": "In-memory file-system with Node's fs API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
682259
10166