Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ZipFS

Hierarchy

Constructors

Properties

Methods

Constructors

constructor

Properties

Private baseFs

baseFs: FakeFS<PortablePath> | null

Private entries

entries: Map<PortablePath, number> = new Map()

Private fds

fds: Map<number, object> = new Map()

Private fileSources

fileSources: Map<number, Buffer> = new Map()

A cache of indices mapped to file sources. Populated by setFileSource calls. Required for supporting read after write.

Private level

Private libzip

libzip: Libzip

Private listings

listings: Map<PortablePath, Set<Filename>> = new Map()

Private lzSource

lzSource: number | null = null

Private nextFd

nextFd: number = 0

Private path

path: PortablePath | null

pathUtils

Private readOnly

readOnly: boolean = false

Private ready

ready: boolean = false

Private stats

stats: Stats

Private symlinkCount

symlinkCount: number

Private zip

zip: number

Methods

accessPromise

  • accessPromise(p: PortablePath, mode?: undefined | number): Promise<void>

accessSync

Private allocateBuffer

  • allocateBuffer(content: string | Buffer | ArrayBuffer | DataView): object

Private allocateSource

  • allocateSource(content: string | Buffer | ArrayBuffer | DataView): number

Private allocateUnattachedSource

  • allocateUnattachedSource(content: string | Buffer | ArrayBuffer | DataView): number

appendFilePromise

appendFileSync

changeFilePromise

changeFileSync

chmodPromise

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

chmodSync

chownPromise

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

chownSync

  • chownSync(p: PortablePath, uid: number, gid: number): void

closePromise

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

closeSync

  • closeSync(fd: number): void

copyFilePromise

copyFileSync

copyPromise

  • copyPromise(destination: PortablePath, source: PortablePath, options?: undefined | object): Promise<void>
  • copyPromise<P2>(destination: PortablePath, source: P2, options: object): Promise<void>

copySync

createReadStream

  • createReadStream(p: PortablePath | null, __namedParameters?: object): ReadStream

createWriteStream

  • createWriteStream(p: PortablePath | null, __namedParameters?: object): WriteStream

Private deleteEntry

discardAndClose

  • discardAndClose(): void

existsPromise

existsSync

fchmodPromise

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

fchmodSync

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

fchownPromise

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

fchownSync

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

Private fdToPath

  • fdToPath(fd: number, reason: string): string & object

fstatPromise

  • fstatPromise(fd: number): Promise<Stats>
  • fstatPromise(fd: number, opts: object): Promise<BigIntStats>
  • fstatPromise(fd: number, opts?: undefined | object): Promise<BigIntStats | Stats>

fstatSync

ftruncatePromise

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

ftruncateSync

  • ftruncateSync(fd: number, len?: undefined | number): void

genTraversePromise

  • genTraversePromise(init: PortablePath, __namedParameters?: object): AsyncGenerator<P, void, unknown>

getAllFiles

  • getAllFiles(): (string & object)[]

getBufferAndClose

  • getBufferAndClose(): Buffer

getExtractHint

Private getFileSource

  • getFileSource(index: number): Buffer
  • getFileSource(index: number, opts: object): Buffer
  • getFileSource(index: number, opts: object): Promise<Buffer>
  • getFileSource(index: number, opts: object): Promise<Buffer> | Buffer

getRealPath

  • getRealPath(): string & object

Private getUnixMode

  • getUnixMode(index: number, defaultMode: number): number

hasOpenFileHandles

  • hasOpenFileHandles(): boolean

Private hydrateDirectory

Private isSymbolicLink

  • isSymbolicLink(index: number): boolean

linkPromise

linkSync

lockPromise

  • lockPromise<T>(affectedPath: PortablePath, callback: function): Promise<T>

lstatPromise

lstatSync

lutimesPromise

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

lutimesSync

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

makeLibzipError

mkdirPromise

mkdirSync

  • mkdirSync(p: PortablePath, __namedParameters?: object): undefined | string

mkdirpPromise

  • mkdirpPromise(p: PortablePath, __namedParameters?: object): Promise<string | undefined>

mkdirpSync

  • mkdirpSync(p: PortablePath, __namedParameters?: object): string | undefined

movePromise

moveSync

openPromise

  • openPromise(p: PortablePath, flags: string, mode?: undefined | number): Promise<number>

openSync

  • openSync(p: PortablePath, flags: string, mode?: undefined | number): number

opendirPromise

opendirSync

Private prepareClose

  • prepareClose(): void

Private prepareCopyFile

Private prepareReadlink

Private prepareWriteFile

preserveTimePromise

  • preserveTimePromise(p: PortablePath, cb: function): Promise<void>

preserveTimeSync

  • preserveTimeSync(p: PortablePath, cb: function): Promise<void>

Private readFileBuffer

readFilePromise

readFileSync

readJsonPromise

readJsonSync

readPromise

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

readSync

  • readSync(fd: number, buffer: Buffer, offset?: number, length?: number, position?: number | null): number

readdirPromise

readdirSync

readlinkPromise

  • readlinkPromise(p: PortablePath): Promise<string & object>

readlinkSync

realpathPromise

  • realpathPromise(p: PortablePath): Promise<string & object>

realpathSync

Private registerEntry

Private registerListing

removePromise

  • removePromise(p: PortablePath, __namedParameters?: object): Promise<void>

removeSync

  • removeSync(p: PortablePath, __namedParameters?: object): void

renamePromise

renameSync

resolve

Private resolveFilename

  • resolveFilename(reason: string, p: PortablePath, resolveLastComponent?: undefined | false | true): PortablePath
  • resolveFilename(reason: string, p: PortablePath, resolveLastComponent: boolean | undefined, throwIfNoEntry: boolean | undefined): PortablePath | undefined

rmdirPromise

rmdirSync

  • rmdirSync(p: PortablePath, __namedParameters?: object): void

saveAndClose

  • saveAndClose(): void

Private setFileSource

  • setFileSource(p: PortablePath, content: string | Buffer | ArrayBuffer | DataView): number

Private statImpl

statPromise

statSync

symlinkPromise

symlinkSync

truncatePromise

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

truncateSync

unlinkPromise

unlinkSync

Private unregisterEntry

Private unregisterListing

unwatchFile

Private utimesImpl

  • utimesImpl(resolvedP: PortablePath, mtime: Date | string | number): void

utimesPromise

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

utimesSync

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

watch

watchFile

writeFilePromise

writeFileSync

writeJsonPromise

  • writeJsonPromise(p: PortablePath, data: any): Promise<void>

writeJsonSync

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>

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

Generated using TypeDoc