Skip to main content

LazyFS <P>

Hierarchy

Index

Constructors

constructor

  • new LazyFS<P>(factory: LazyFSFactory<P>, pathUtils: PathUtils<P>): LazyFS<P>
  • Type parameters

    Parameters

    • factory: LazyFSFactory<P>
    • pathUtils: PathUtils<P>

    Returns LazyFS<P>

Properties

publicreadonlypathUtils

pathUtils: PathUtils<P>

Methods

accessPromise

  • accessPromise(p: P, mode?: number): Promise<void>
  • Parameters

    • p: P
    • optionalmode: number

    Returns Promise<void>

accessSync

  • accessSync(p: P, mode?: number): void
  • Parameters

    • p: P
    • optionalmode: number

    Returns void

appendFilePromise

  • Parameters

    Returns Promise<void>

appendFileSync

  • Parameters

    Returns void

changeFilePromise

  • changeFilePromise(p: P, content: Buffer): Promise<void>
  • changeFilePromise(p: P, content: string, opts?: Partial<{ automaticNewlines: boolean; mode: number }>): Promise<void>
  • Parameters

    • p: P
    • content: Buffer

    Returns Promise<void>

changeFileSync

  • changeFileSync(p: P, content: Buffer): void
  • changeFileSync(p: P, content: string, opts?: Partial<{ automaticNewlines: boolean; mode: number }>): void
  • Parameters

    • p: P
    • content: Buffer

    Returns void

checksumFilePromise

  • checksumFilePromise(path: P, __namedParameters?: { algorithm?: string }): Promise<string>
  • Parameters

    • path: P
    • __namedParameters: { algorithm?: string } = {}

    Returns Promise<string>

chmodPromise

  • chmodPromise(p: P, mask: number): Promise<void>
  • Parameters

    • p: P
    • mask: number

    Returns Promise<void>

chmodSync

  • chmodSync(p: P, mask: number): void
  • Parameters

    • p: P
    • mask: number

    Returns void

chownPromise

  • chownPromise(p: P, uid: number, gid: number): Promise<void>
  • Parameters

    • p: P
    • uid: number
    • gid: number

    Returns Promise<void>

chownSync

  • chownSync(p: P, uid: number, gid: number): void
  • Parameters

    • p: P
    • uid: number
    • gid: number

    Returns void

closePromise

  • closePromise(fd: number): Promise<void>
  • Parameters

    • fd: number

    Returns Promise<void>

closeSync

  • closeSync(fd: number): void
  • Parameters

    • fd: number

    Returns void

copyFilePromise

  • copyFilePromise(sourceP: P, destP: P, flags?: number): Promise<void>
  • Parameters

    • sourceP: P
    • destP: P
    • flags: number = 0

    Returns Promise<void>

copyFileSync

  • copyFileSync(sourceP: P, destP: P, flags?: number): void
  • Parameters

    • sourceP: P
    • destP: P
    • flags: number = 0

    Returns void

copyPromise

  • copyPromise(destination: P, source: P, options?: { baseFs?: undefined; linkStrategy?: null | LinkStrategy<P>; overwrite?: boolean; stableSort?: boolean; stableTime?: boolean }): Promise<void>
  • copyPromise<P2>(destination: P, source: P2, options: { baseFs: FakeFS<P2>; linkStrategy?: null | LinkStrategy<P>; overwrite?: boolean; stableSort?: boolean; stableTime?: boolean }): Promise<void>
  • Parameters

    • destination: P
    • source: P
    • optionaloptions: { baseFs?: undefined; linkStrategy?: null | LinkStrategy<P>; overwrite?: boolean; stableSort?: boolean; stableTime?: boolean }

    Returns Promise<void>

copySync

  • copySync(destination: P, source: P, options?: { baseFs?: undefined; overwrite?: boolean }): void
  • copySync<P2>(destination: P, source: P2, options: { baseFs: FakeFS<P2>; overwrite?: boolean }): void
  • @deprecated

    Prefer using copyPromise instead


    Parameters

    • destination: P
    • source: P
    • optionaloptions: { baseFs?: undefined; overwrite?: boolean }

    Returns void

createReadStream

  • createReadStream(p: null | P, opts?: Partial<{ encoding: BufferEncoding; fd: number }>): ReadStream
  • Parameters

    • p: null | P
    • optionalopts: Partial<{ encoding: BufferEncoding; fd: number }>

    Returns ReadStream

createWriteStream

  • createWriteStream(p: null | P, opts?: Partial<{ encoding: BufferEncoding; fd: number; flags: a }>): WriteStream
  • Parameters

    • p: null | P
    • optionalopts: Partial<{ encoding: BufferEncoding; fd: number; flags: a }>

    Returns WriteStream

existsPromise

  • existsPromise(p: P): Promise<boolean>
  • Parameters

    • p: P

    Returns Promise<boolean>

existsSync

  • existsSync(p: P): boolean
  • Parameters

    • p: P

    Returns boolean

fchmodPromise

  • fchmodPromise(fd: number, mask: number): Promise<void>
  • Parameters

    • fd: number
    • mask: number

    Returns Promise<void>

fchmodSync

  • fchmodSync(fd: number, mask: number): void
  • Parameters

    • fd: number
    • mask: number

    Returns void

fchownPromise

  • fchownPromise(fd: number, uid: number, gid: number): Promise<void>
  • Parameters

    • fd: number
    • uid: number
    • gid: number

    Returns Promise<void>

fchownSync

  • fchownSync(fd: number, uid: number, gid: number): void
  • Parameters

    • fd: number
    • uid: number
    • gid: number

    Returns void

fstatPromise

  • fstatPromise(fd: number): Promise<Stats>
  • fstatPromise(fd: number, opts: { bigint: true }): Promise<BigIntStats>
  • fstatPromise(fd: number, opts?: { bigint: boolean }): Promise<Stats | BigIntStats>
  • Parameters

    • fd: number

    Returns Promise<Stats>

fstatSync

  • fstatSync(fd: number): Stats
  • fstatSync(fd: number, opts: { bigint: true }): BigIntStats
  • fstatSync(fd: number, opts?: { bigint: boolean }): Stats | BigIntStats
  • Parameters

    • fd: number

    Returns Stats

ftruncatePromise

  • ftruncatePromise(fd: number, len?: number): Promise<void>
  • Parameters

    • fd: number
    • optionallen: number

    Returns Promise<void>

ftruncateSync

  • ftruncateSync(fd: number, len?: number): void
  • Parameters

    • fd: number
    • optionallen: number

    Returns void

genTraversePromise

  • genTraversePromise(init: P, __namedParameters?: { stableSort?: boolean }): AsyncGenerator<P, void, unknown>
  • Parameters

    • init: P
    • __namedParameters: { stableSort?: boolean } = {}

    Returns AsyncGenerator<P, void, unknown>

getExtractHint

  • @deprecated: Moved to jsInstallUtils


    Parameters

    Returns boolean

getRealPath

  • getRealPath(): P
  • Returns P

linkPromise

  • linkPromise(existingP: P, newP: P): Promise<void>
  • Parameters

    • existingP: P
    • newP: P

    Returns Promise<void>

linkSync

  • linkSync(existingP: P, newP: P): void
  • Parameters

    • existingP: P
    • newP: P

    Returns void

lockPromise

  • lockPromise<T>(affectedPath: P, callback: () => Promise<T>): Promise<T>
  • Type parameters

    • T

    Parameters

    • affectedPath: P
    • callback: () => Promise<T>

    Returns Promise<T>

lstatPromise

  • lstatPromise(p: P): Promise<Stats>
  • lstatPromise(p: P, opts: undefined | (StatOptions & { bigint?: false })): Promise<Stats>
  • lstatPromise(p: P, opts: StatOptions & { bigint: true }): Promise<BigIntStats>
  • Parameters

    • p: P

    Returns Promise<Stats>

lstatSync

  • lstatSync(p: P): Stats
  • lstatSync(p: P, opts?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }): undefined | Stats
  • lstatSync(p: P, opts: StatSyncOptions & { bigint: true; throwIfNoEntry: false }): undefined | BigIntStats
  • lstatSync(p: P, opts?: StatSyncOptions & { bigint?: false }): Stats
  • lstatSync(p: P, opts: StatSyncOptions & { bigint: true }): BigIntStats
  • lstatSync(p: P, opts: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }): Stats | BigIntStats
  • Parameters

    • p: P

    Returns Stats

lutimesPromise

  • lutimesPromise(p: P, atime: string | number | Date, mtime: string | number | Date): Promise<void>
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns Promise<void>

lutimesSync

  • lutimesSync(p: P, atime: string | number | Date, mtime: string | number | Date): void
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns void

mkdirPromise

  • mkdirPromise(p: P, opts?: Partial<{ mode: number; recursive: boolean }>): Promise<undefined | string>
  • Parameters

    • p: P
    • optionalopts: Partial<{ mode: number; recursive: boolean }>

    Returns Promise<undefined | string>

mkdirSync

  • mkdirSync(p: P, opts?: Partial<{ mode: number; recursive: boolean }>): undefined | string
  • Parameters

    • p: P
    • optionalopts: Partial<{ mode: number; recursive: boolean }>

    Returns undefined | string

mkdirpPromise

  • mkdirpPromise(p: P, __namedParameters?: { chmod?: number; utimes?: [string | number | Date, string | number | Date] }): Promise<undefined | string>
  • Parameters

    • p: P
    • __namedParameters: { chmod?: number; utimes?: [string | number | Date, string | number | Date] } = {}

    Returns Promise<undefined | string>

mkdirpSync

  • mkdirpSync(p: P, __namedParameters?: { chmod?: number; utimes?: [string | number | Date, string | number | Date] }): undefined | string
  • Parameters

    • p: P
    • __namedParameters: { chmod?: number; utimes?: [string | number | Date, string | number | Date] } = {}

    Returns undefined | string

movePromise

  • movePromise(fromP: P, toP: P): Promise<void>
  • Parameters

    • fromP: P
    • toP: P

    Returns Promise<void>

moveSync

  • moveSync(fromP: P, toP: P): void
  • Parameters

    • fromP: P
    • toP: P

    Returns void

openPromise

  • openPromise(p: P, flags: string, mode?: number): Promise<number>
  • Parameters

    • p: P
    • flags: string
    • optionalmode: number

    Returns Promise<number>

openSync

  • openSync(p: P, flags: string, mode?: number): number
  • Parameters

    • p: P
    • flags: string
    • optionalmode: number

    Returns number

opendirPromise

  • opendirPromise(p: P, opts?: Partial<{ bufferSize: number; recursive: boolean }>): Promise<Dir<P>>
  • Parameters

    • p: P
    • optionalopts: Partial<{ bufferSize: number; recursive: boolean }>

    Returns Promise<Dir<P>>

opendirSync

  • opendirSync(p: P, opts?: Partial<{ bufferSize: number; recursive: boolean }>): Dir<P>
  • Parameters

    • p: P
    • optionalopts: Partial<{ bufferSize: number; recursive: boolean }>

    Returns Dir<P>

preserveTimePromise

  • preserveTimePromise(p: P, cb: () => Promise<void | P>): Promise<void>
  • Parameters

    • p: P
    • cb: () => Promise<void | P>

    Returns Promise<void>

preserveTimeSync

  • preserveTimeSync(p: P, cb: () => void | P): Promise<void>
  • Parameters

    • p: P
    • cb: () => void | P

    Returns Promise<void>

readFilePromise

  • readFilePromise(p: FSPath<P>, encoding?: null): Promise<Buffer>
  • readFilePromise(p: FSPath<P>, encoding: BufferEncoding): Promise<string>
  • readFilePromise(p: FSPath<P>, encoding?: null | BufferEncoding): Promise<string | Buffer>
  • Parameters

    • p: FSPath<P>
    • optionalencoding: null

    Returns Promise<Buffer>

readFileSync

  • readFileSync(p: FSPath<P>, encoding?: null): Buffer
  • readFileSync(p: FSPath<P>, encoding: BufferEncoding): string
  • readFileSync(p: FSPath<P>, encoding?: null | BufferEncoding): string | Buffer
  • Parameters

    • p: FSPath<P>
    • optionalencoding: null

    Returns Buffer

readJsonPromise

  • readJsonPromise(p: P): Promise<any>
  • Parameters

    • p: P

    Returns Promise<any>

readJsonSync

  • readJsonSync(p: P): any
  • Parameters

    • p: P

    Returns any

readPromise

  • readPromise(fd: number, buffer: Buffer, offset?: number, length?: number, position?: null | number): Promise<number>
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: null | number

    Returns Promise<number>

readSync

  • readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number
  • Parameters

    • fd: number
    • buffer: Buffer
    • offset: number
    • length: number
    • position: number

    Returns number

readdirPromise

  • readdirPromise(p: P, opts?: null): Promise<Filename[]>
  • readdirPromise(p: P, opts: { recursive?: false; withFileTypes: true }): Promise<DirentNoPath[]>
  • readdirPromise(p: P, opts: { recursive?: false; withFileTypes?: false }): Promise<Filename[]>
  • readdirPromise(p: P, opts: { recursive?: false; withFileTypes: boolean }): Promise<(Filename | DirentNoPath)[]>
  • readdirPromise(p: P, opts: { recursive: true; withFileTypes: true }): Promise<Dirent<P>[]>
  • readdirPromise(p: P, opts: { recursive: true; withFileTypes?: false }): Promise<P[]>
  • readdirPromise(p: P, opts: { recursive: true; withFileTypes: boolean }): Promise<(P | Dirent<P>)[]>
  • readdirPromise(p: P, opts: { recursive: boolean; withFileTypes: true }): Promise<(DirentNoPath | Dirent<P>)[]>
  • readdirPromise(p: P, opts: { recursive: boolean; withFileTypes?: false }): Promise<P[]>
  • readdirPromise(p: P, opts: { recursive: boolean; withFileTypes: boolean }): Promise<(DirentNoPath | P | Dirent<P>)[]>
  • Parameters

    • p: P
    • optionalopts: null

    Returns Promise<Filename[]>

readdirSync

  • readdirSync(p: P, opts?: null): Filename[]
  • readdirSync(p: P, opts: { recursive?: false; withFileTypes: true }): DirentNoPath[]
  • readdirSync(p: P, opts: { recursive?: false; withFileTypes?: false }): Filename[]
  • readdirSync(p: P, opts: { recursive?: false; withFileTypes: boolean }): (Filename | DirentNoPath)[]
  • readdirSync(p: P, opts: { recursive: true; withFileTypes: true }): Dirent<P>[]
  • readdirSync(p: P, opts: { recursive: true; withFileTypes?: false }): P[]
  • readdirSync(p: P, opts: { recursive: true; withFileTypes: boolean }): (P | Dirent<P>)[]
  • readdirSync(p: P, opts: { recursive: boolean; withFileTypes: true }): (DirentNoPath | Dirent<P>)[]
  • readdirSync(p: P, opts: { recursive: boolean; withFileTypes?: false }): P[]
  • readdirSync(p: P, opts: { recursive: boolean; withFileTypes: boolean }): (DirentNoPath | P | Dirent<P>)[]
  • Parameters

    • p: P
    • optionalopts: null

    Returns Filename[]

readlinkPromise

  • readlinkPromise(p: P): Promise<P>
  • Parameters

    • p: P

    Returns Promise<P>

readlinkSync

  • readlinkSync(p: P): P
  • Parameters

    • p: P

    Returns P

realpathPromise

  • realpathPromise(p: P): Promise<P>
  • Parameters

    • p: P

    Returns Promise<P>

realpathSync

  • realpathSync(p: P): P
  • Parameters

    • p: P

    Returns P

removePromise

  • removePromise(p: P, __namedParameters?: { maxRetries?: number; recursive?: boolean }): Promise<void>
  • Parameters

    • p: P
    • __namedParameters: { maxRetries?: number; recursive?: boolean } = {}

    Returns Promise<void>

removeSync

  • removeSync(p: P, __namedParameters?: { recursive?: boolean }): void
  • Parameters

    • p: P
    • __namedParameters: { recursive?: boolean } = {}

    Returns void

renamePromise

  • renamePromise(oldP: P, newP: P): Promise<void>
  • Parameters

    • oldP: P
    • newP: P

    Returns Promise<void>

renameSync

  • renameSync(oldP: P, newP: P): void
  • Parameters

    • oldP: P
    • newP: P

    Returns void

resolve

  • resolve(path: P): P
  • Parameters

    • path: P

    Returns P

rmdirPromise

  • rmdirPromise(p: P, opts?: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>): Promise<void>
  • Parameters

    • p: P
    • optionalopts: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>

    Returns Promise<void>

rmdirSync

  • rmdirSync(p: P, opts?: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>): void
  • Parameters

    • p: P
    • optionalopts: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>

    Returns void

statPromise

  • statPromise(p: P): Promise<Stats>
  • statPromise(p: P, opts: undefined | (StatOptions & { bigint?: false })): Promise<Stats>
  • statPromise(p: P, opts: StatOptions & { bigint: true }): Promise<BigIntStats>
  • Parameters

    • p: P

    Returns Promise<Stats>

statSync

  • statSync(p: P): Stats
  • statSync(p: P, opts?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }): undefined | Stats
  • statSync(p: P, opts: StatSyncOptions & { bigint: true; throwIfNoEntry: false }): undefined | BigIntStats
  • statSync(p: P, opts?: StatSyncOptions & { bigint?: false }): Stats
  • statSync(p: P, opts: StatSyncOptions & { bigint: true }): BigIntStats
  • statSync(p: P, opts: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }): Stats | BigIntStats
  • Parameters

    • p: P

    Returns Stats

symlinkPromise

  • symlinkPromise(target: P, p: P, type?: SymlinkType): Promise<void>
  • Parameters

    Returns Promise<void>

symlinkSync

  • Parameters

    Returns void

truncatePromise

  • truncatePromise(p: P, len?: number): Promise<void>
  • Parameters

    • p: P
    • optionallen: number

    Returns Promise<void>

truncateSync

  • truncateSync(p: P, len?: number): void
  • Parameters

    • p: P
    • optionallen: number

    Returns void

unlinkPromise

  • unlinkPromise(p: P): Promise<void>
  • Parameters

    • p: P

    Returns Promise<void>

unlinkSync

  • unlinkSync(p: P): void
  • Parameters

    • p: P

    Returns void

unwatchFile

  • Parameters

    Returns void

utimesPromise

  • utimesPromise(p: P, atime: string | number | Date, mtime: string | number | Date): Promise<void>
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns Promise<void>

utimesSync

  • utimesSync(p: P, atime: string | number | Date, mtime: string | number | Date): void
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns void

watch

watchFile

writeFilePromise

  • Parameters

    Returns Promise<void>

writeFileSync

  • Parameters

    Returns void

writeJsonPromise

  • writeJsonPromise(p: P, data: any, __namedParameters?: { compact?: boolean }): Promise<void>
  • Parameters

    • p: P
    • data: any
    • __namedParameters: { compact?: boolean } = {}

    Returns Promise<void>

writeJsonSync

  • writeJsonSync(p: P, data: any, __namedParameters?: { compact?: boolean }): void
  • Parameters

    • p: P
    • data: any
    • __namedParameters: { compact?: boolean } = {}

    Returns void

writePromise

  • writePromise(fd: number, buffer: Buffer, offset?: number, length?: number, position?: number): Promise<number>
  • writePromise(fd: number, buffer: string, position?: number): Promise<number>
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: number

    Returns Promise<number>

writeSync

  • writeSync(fd: number, buffer: Buffer, offset?: number, length?: number, position?: number): number
  • writeSync(fd: number, buffer: string, position?: number): number
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: number

    Returns number