Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memfs

Package Overview
Dependencies
Maintainers
0
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memfs - npm Package Compare versions

Comparing version 4.14.1 to 4.15.0

4

lib/node/FileHandle.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc