Class FakeFS<P>
Methods
Abstract accessPromise
- accessPromise(p: P, mode?: undefined | number): Promise<void>
-
Parameters
-
p: P
-
Optional mode: undefined | number
Returns Promise<void>
Abstract accessSync
- accessSync(p: P, mode?: undefined | number): void
-
Parameters
-
p: P
-
Optional mode: undefined | number
Returns void
Abstract appendFilePromise
-
Parameters
-
-
content: string | Uint8Array
-
Returns Promise<void>
Abstract appendFileSync
-
Parameters
-
-
content: string | Uint8Array
-
Returns void
Private changeFileBufferPromise
- changeFileBufferPromise(p: P, content: Buffer, __namedParameters?: object): Promise<void>
-
Parameters
-
p: P
-
content: Buffer
-
Default value __namedParameters: object = {}
Returns Promise<void>
Private changeFileBufferSync
- changeFileBufferSync(p: P, content: Buffer, __namedParameters?: object): void
-
Parameters
-
p: P
-
content: Buffer
-
Default value __namedParameters: object = {}
Returns void
changeFilePromise
- changeFilePromise(p: P, content: Buffer): Promise<void>
- changeFilePromise(p: P, content: string, opts?: ChangeFileOptions): Promise<void>
-
Parameters
Returns Promise<void>
-
Parameters
Returns Promise<void>
changeFileSync
- changeFileSync(p: P, content: Buffer): void
- changeFileSync(p: P, content: string, opts?: ChangeFileOptions): void
-
Parameters
Returns void
-
Parameters
Returns void
Private changeFileTextPromise
- changeFileTextPromise(p: P, content: string, __namedParameters?: object): Promise<void>
-
Parameters
-
p: P
-
content: string
-
Default value __namedParameters: object = {}
-
automaticNewlines: undefined | false | true
-
mode: undefined | number
Returns Promise<void>
Private changeFileTextSync
- changeFileTextSync(p: P, content: string, __namedParameters?: object): void
-
Parameters
-
p: P
-
content: string
-
Default value __namedParameters: object = {}
-
automaticNewlines: boolean
-
mode: undefined | number
Returns void
checksumFilePromise
- checksumFilePromise(path: P, __namedParameters?: object): Promise<string>
-
Parameters
-
path: P
-
Default value __namedParameters: object = {}
Returns Promise<string>
Abstract chmodPromise
- chmodPromise(p: P, mask: number): Promise<void>
-
Parameters
Returns Promise<void>
Abstract chmodSync
- chmodSync(p: P, mask: number): void
Abstract chownPromise
- chownPromise(p: P, uid: number, gid: number): Promise<void>
-
Parameters
-
p: P
-
uid: number
-
gid: number
Returns Promise<void>
Abstract chownSync
- chownSync(p: P, uid: number, gid: number): void
-
Parameters
-
p: P
-
uid: number
-
gid: number
Returns void
Abstract closePromise
- closePromise(fd: number): Promise<void>
-
Parameters
Returns Promise<void>
Abstract closeSync
- closeSync(fd: number): void
Abstract copyFilePromise
- copyFilePromise(sourceP: P, destP: P, flags?: undefined | number): Promise<void>
-
Parameters
-
sourceP: P
-
destP: P
-
Optional flags: undefined | number
Returns Promise<void>
Abstract copyFileSync
- copyFileSync(sourceP: P, destP: P, flags?: undefined | number): void
-
Parameters
-
sourceP: P
-
destP: P
-
Optional flags: undefined | number
Returns void
copyPromise
- copyPromise(destination: P, source: P, options?: undefined | object): Promise<void>
- copyPromise<P2>(destination: P, source: P2, options: object): Promise<void>
-
Parameters
-
destination: P
-
source: P
-
Optional options: undefined | object
Returns Promise<void>
-
Type parameters
Parameters
-
destination: P
-
source: P2
-
options: object
-
-
Optional linkStrategy?: LinkStrategy<P> | null
-
Optional overwrite?: undefined | false | true
-
Optional stableSort?: undefined | false | true
-
Optional stableTime?: undefined | false | true
Returns Promise<void>
copySync
- copySync(destination: P, source: P, options?: undefined | object): void
- copySync<P2>(destination: P, source: P2, options: object): void
-
Parameters
-
destination: P
-
source: P
-
Optional options: undefined | object
Returns void
-
Type parameters
Parameters
-
destination: P
-
source: P2
-
options: object
-
-
Optional overwrite?: undefined | false | true
Returns void
Abstract createReadStream
-
Parameters
Returns ReadStream
Abstract createWriteStream
-
Parameters
Returns WriteStream
Abstract existsPromise
- existsPromise(p: P): Promise<boolean>
-
Parameters
Returns Promise<boolean>
Abstract existsSync
- existsSync(p: P): boolean
-
Parameters
Returns boolean
Abstract fchmodPromise
- fchmodPromise(fd: number, mask: number): Promise<void>
-
Parameters
Returns Promise<void>
Abstract fchmodSync
- fchmodSync(fd: number, mask: number): void
Abstract fchownPromise
- fchownPromise(fd: number, uid: number, gid: number): Promise<void>
-
Parameters
-
fd: number
-
uid: number
-
gid: number
Returns Promise<void>
Abstract fchownSync
- fchownSync(fd: number, uid: number, gid: number): void
-
Parameters
-
fd: number
-
uid: number
-
gid: number
Returns void
Abstract fstatPromise
- fstatPromise(fd: number): Promise<Stats>
- fstatPromise(fd: number, opts: object): Promise<BigIntStats>
- fstatPromise(fd: number, opts?: undefined | object): Promise<BigIntStats | Stats>
-
Parameters
Returns Promise<Stats>
-
Parameters
-
Parameters
-
fd: number
-
Optional opts: undefined | object
Abstract fstatSync
-
Parameters
-
Parameters
-
Parameters
-
fd: number
-
Optional opts: undefined | object
Abstract ftruncatePromise
- ftruncatePromise(fd: number, len?: undefined | number): Promise<void>
-
Parameters
-
fd: number
-
Optional len: undefined | number
Returns Promise<void>
Abstract ftruncateSync
- ftruncateSync(fd: number, len?: undefined | number): void
-
Parameters
-
fd: number
-
Optional len: undefined | number
Returns void
genTraversePromise
- genTraversePromise(init: P, __namedParameters?: object): AsyncGenerator<P, void, unknown>
-
Parameters
-
init: P
-
Default value __namedParameters: object = {}
Returns AsyncGenerator<P, void, unknown>
Abstract getExtractHint
-
Parameters
Returns boolean
Abstract linkPromise
- linkPromise(existingP: P, newP: P): Promise<void>
-
Parameters
Returns Promise<void>
Abstract linkSync
- linkSync(existingP: P, newP: P): void
lockPromise
- lockPromise<T>(affectedPath: P, callback: function): Promise<T>
-
Type parameters
Parameters
-
affectedPath: P
-
callback: function
Returns Promise<T>
Abstract lstatPromise
-
Parameters
Returns Promise<Stats>
-
Parameters
Returns Promise<Stats>
-
Parameters
-
Parameters
Abstract lstatSync
-
Parameters
-
Parameters
Returns Stats
|
undefined
-
Parameters
-
Parameters
-
Parameters
-
Parameters
-
Parameters
Abstract lutimesPromise
- lutimesPromise(p: P, atime: Date | string | number, mtime: Date | string | number): Promise<void>
-
Parameters
-
p: P
-
atime: Date | string | number
-
mtime: Date | string | number
Returns Promise<void>
Abstract lutimesSync
- lutimesSync(p: P, atime: Date | string | number, mtime: Date | string | number): void
-
Parameters
-
p: P
-
atime: Date | string | number
-
mtime: Date | string | number
Returns void
Abstract mkdirPromise
- mkdirPromise(p: P, opts?: MkdirOptions): Promise<string | undefined>
-
Parameters
Returns Promise<string | undefined>
Abstract mkdirSync
-
Parameters
Returns string
|
undefined
mkdirpPromise
- mkdirpPromise(p: P, __namedParameters?: object): Promise<string | undefined>
-
Parameters
-
p: P
-
Default value __namedParameters: object = {}
-
chmod: undefined | number
-
utimes: undefined | [string | number | Date, string | number | Date]
Returns Promise<string | undefined>
mkdirpSync
- mkdirpSync(p: P, __namedParameters?: object): string | undefined
-
Parameters
-
p: P
-
Default value __namedParameters: object = {}
-
chmod: undefined | number
-
utimes: undefined | [string | number | Date, string | number | Date]
Returns string
|
undefined
movePromise
- movePromise(fromP: P, toP: P): Promise<void>
-
Parameters
Returns Promise<void>
moveSync
- moveSync(fromP: P, toP: P): void
Abstract openPromise
- openPromise(p: P, flags: string, mode?: undefined | number): Promise<number>
-
Parameters
-
p: P
-
flags: string
-
Optional mode: undefined | number
Returns Promise<number>
Abstract openSync
- openSync(p: P, flags: string, mode?: undefined | number): number
-
Parameters
-
p: P
-
flags: string
-
Optional mode: undefined | number
Returns number
Abstract opendirPromise
-
Parameters
Returns Promise<Dir<P>>
Abstract opendirSync
-
Parameters
Returns Dir<P>
preserveTimePromise
- preserveTimePromise(p: P, cb: function): Promise<void>
-
Parameters
-
p: P
-
cb: function
-
-
Returns Promise<P | void>
Returns Promise<void>
preserveTimeSync
- preserveTimeSync(p: P, cb: function): Promise<void>
-
Parameters
Returns Promise<void>
Abstract readFilePromise
- readFilePromise(p: FSPath<P>, encoding?: undefined | null): Promise<Buffer>
- readFilePromise(p: FSPath<P>, encoding: BufferEncoding): Promise<string>
- readFilePromise(p: FSPath<P>, encoding?: BufferEncoding | null): Promise<Buffer | string>
-
Parameters
-
-
Optional encoding: undefined | null
Returns Promise<Buffer>
-
Parameters
Returns Promise<string>
-
Parameters
-
-
Optional encoding: BufferEncoding | null
Returns Promise<Buffer | string>
Abstract readFileSync
- readFileSync(p: FSPath<P>, encoding?: undefined | null): Buffer
- readFileSync(p: FSPath<P>, encoding: BufferEncoding): string
- readFileSync(p: FSPath<P>, encoding?: BufferEncoding | null): Buffer | string
-
Parameters
-
-
Optional encoding: undefined | null
Returns Buffer
-
Parameters
Returns string
-
Parameters
-
-
Optional encoding: BufferEncoding | null
Returns Buffer
|
string
readJsonPromise
- readJsonPromise(p: P): Promise<any>
-
Parameters
Returns Promise<any>
Abstract readPromise
- readPromise(fd: number, buffer: Buffer, offset?: undefined | number, length?: undefined | number, position?: number | null): Promise<number>
-
Parameters
-
fd: number
-
buffer: Buffer
-
Optional offset: undefined | number
-
Optional length: undefined | number
-
Optional position: number | null
Returns Promise<number>
Abstract readSync
- readSync(fd: number, buffer: Buffer, offset?: undefined | number, length?: undefined | number, position?: number | null): number
-
Parameters
-
fd: number
-
buffer: Buffer
-
Optional offset: undefined | number
-
Optional length: undefined | number
-
Optional position: number | null
Returns number
Abstract readdirPromise
- readdirPromise(p: P): Promise<Array<Filename>>
- readdirPromise(p: P, opts: object | null): Promise<Array<Filename>>
- readdirPromise(p: P, opts: object): Promise<Array<Dirent>>
- readdirPromise(p: P, opts: object): Promise<Array<Filename> | Array<Dirent>>
-
Parameters
Returns Promise<Array<Filename>>
-
Parameters
Returns Promise<Array<Filename>>
-
Parameters
Returns Promise<Array<Dirent>>
-
Parameters
Returns Promise<Array<Filename> | Array<Dirent>>
Abstract readdirSync
- readdirSync(p: P): Array<Filename>
- readdirSync(p: P, opts: object | null): Array<Filename>
- readdirSync(p: P, opts: object): Array<Dirent>
- readdirSync(p: P, opts: object): Array<Filename> | Array<Dirent>
-
Parameters
-
Parameters
-
Parameters
Returns Array<Dirent>
-
Parameters
Abstract readlinkPromise
- readlinkPromise(p: P): Promise<P>
-
Parameters
Returns Promise<P>
Abstract realpathPromise
- realpathPromise(p: P): Promise<P>
-
Parameters
Returns Promise<P>
removePromise
- removePromise(p: P, __namedParameters?: object): Promise<void>
-
Parameters
-
p: P
-
Default value __namedParameters: object = {}
-
maxRetries: number
-
recursive: boolean
Returns Promise<void>
removeSync
- removeSync(p: P, __namedParameters?: object): void
-
Parameters
-
p: P
-
Default value __namedParameters: object = {}
Returns void
Abstract renamePromise
- renamePromise(oldP: P, newP: P): Promise<void>
-
Parameters
Returns Promise<void>
Abstract renameSync
- renameSync(oldP: P, newP: P): void
Abstract rmdirPromise
-
Parameters
Returns Promise<void>
Abstract statPromise
-
Parameters
Returns Promise<Stats>
-
Parameters
Returns Promise<Stats>
-
Parameters
-
Parameters
Abstract statSync
-
Parameters
-
Parameters
Returns Stats
|
undefined
-
Parameters
-
Parameters
-
Parameters
-
Parameters
-
Parameters
Abstract symlinkPromise
- symlinkPromise(target: P, p: P, type?: SymlinkType): Promise<void>
-
Parameters
Returns Promise<void>
Abstract truncatePromise
- truncatePromise(p: P, len?: undefined | number): Promise<void>
-
Parameters
-
p: P
-
Optional len: undefined | number
Returns Promise<void>
Abstract truncateSync
- truncateSync(p: P, len?: undefined | number): void
-
Parameters
-
p: P
-
Optional len: undefined | number
Returns void
Abstract unlinkPromise
- unlinkPromise(p: P): Promise<void>
-
Parameters
Returns Promise<void>
Abstract utimesPromise
- utimesPromise(p: P, atime: Date | string | number, mtime: Date | string | number): Promise<void>
-
Parameters
-
p: P
-
atime: Date | string | number
-
mtime: Date | string | number
Returns Promise<void>
Abstract utimesSync
- utimesSync(p: P, atime: Date | string | number, mtime: Date | string | number): void
-
Parameters
-
p: P
-
atime: Date | string | number
-
mtime: Date | string | number
Returns void
Abstract writeFilePromise
- writeFilePromise(p: FSPath<P>, content: string | NodeJS.ArrayBufferView, opts?: WriteFileOptions): Promise<void>
-
Parameters
-
-
content: string | NodeJS.ArrayBufferView
-
Returns Promise<void>
Abstract writeFileSync
-
Parameters
-
-
content: string | NodeJS.ArrayBufferView
-
Returns void
writeJsonPromise
- writeJsonPromise(p: P, data: any): Promise<void>
-
Parameters
Returns Promise<void>
writeJsonSync
- writeJsonSync(p: P, data: any): void
Abstract writePromise
- writePromise(fd: number, buffer: Buffer, offset?: undefined | number, length?: undefined | number, position?: undefined | number): Promise<number>
- writePromise(fd: number, buffer: string, position?: undefined | number): Promise<number>
-
Parameters
-
fd: number
-
buffer: Buffer
-
Optional offset: undefined | number
-
Optional length: undefined | number
-
Optional position: undefined | number
Returns Promise<number>
-
Parameters
-
fd: number
-
buffer: string
-
Optional position: undefined | number
Returns Promise<number>
Abstract writeSync
- writeSync(fd: number, buffer: Buffer, offset?: undefined | number, length?: undefined | number, position?: undefined | number): number
- writeSync(fd: number, buffer: string, position?: undefined | number): number
-
Parameters
-
fd: number
-
buffer: Buffer
-
Optional offset: undefined | number
-
Optional length: undefined | number
-
Optional position: undefined | number
Returns number
-
Parameters
-
fd: number
-
buffer: string
-
Optional position: undefined | number
Returns number
Prefer using
copyPromise
instead