Options
All
  • Public
  • Public/Protected
  • All
Menu

A read-only file system view for ZIP files.

Hierarchy

Index

Constructors

constructor

  • new ZipReadOnlyFileSystem(prefix: string, archive: Uint8Array): ZipReadOnlyFileSystem
  • new ZipReadOnlyFileSystem(prefix: string): any
  • Creates a new instance of the ZipReadOnlyFileSystem FS class.

    Parameters

    • prefix: string

      The prefix to use (e.g. c:)

    • archive: Uint8Array

      The archive data.

    Returns ZipReadOnlyFileSystem

  • Parameters

    • prefix: string

    Returns any

Properties

archive

archive: any

JSZip object

archiveData

archiveData: Uint8Array

Archive data.

driverName

driverName: string

The unique driver name.

features

features: []

An array which contains the supported file system features.

prefix

prefix: string

The prefix (aka drive letter) for the current file system instance.

This is managed by the OS.

remote

remote: boolean

Whether the file system has resources to be accessed remotely.

volumeLabel

volumeLabel: string

The volume label.

Methods

cpdir

  • cpdir(src: string, dest: string): Promise<boolean>
  • Copies a directory to a new destination.

    Parameters

    • src: string

      The source path to copy from.

    • dest: string

      The destination path to place copied files.

    Returns Promise<boolean>

cpfile

  • cpfile(src: string, dest: string): Promise<boolean>
  • Copies a file to a new destination.

    Parameters

    • src: string

      The source path to copy from.

    • dest: string

      The destination path to place the copied file.

    Returns Promise<boolean>

exists

  • exists(path: string): boolean
  • Checks if an entity exists.

    Parameters

    • path: string

      The path to check for.

    Returns boolean

filetype

  • filetype(path: string): 0 | 1 | -1
  • Returns the file type of a node. This can be a binary or text file.

    Parameters

    • path: string

      The path to check for.

    Returns 0 | 1 | -1

    A number representing the file type.

init

  • init(): Promise<void>
  • Initializes the file system.

    Returns Promise<void>

isEmpty

  • isEmpty(path: string): Promise<boolean>
  • Checks if a file is empty.

    Parameters

    • path: string

      The path to check for.

    Returns Promise<boolean>

isFile

  • isFile(path: string): Promise<boolean>
  • Checks if the specified entity is a file.

    Parameters

    • path: string

      The path to check for.

    Returns Promise<boolean>

mkdir

  • mkdir(path: string): Promise<boolean>
  • Creates a new directory (and subdirectories if they do not exist).

    Parameters

    • path: string

      The path of the directory to create.

    Returns Promise<boolean>

mvdir

  • mvdir(src: string, dest: string): Promise<boolean>
  • Moves a directory to a new destination.

    Parameters

    • src: string

      The source path to move from.

    • dest: string

      The destination path to place moved files.

    Returns Promise<boolean>

mvfile

  • mvfile(src: string, dest: string): Promise<boolean>
  • Moves a file to a new destination.

    Parameters

    • src: string

      The source path to move from.

    • dest: string

      The destination path to place the moved file.

    Returns Promise<boolean>

readbin

  • readbin(path: string): Promise<Uint8Array>
  • Reads the specified file as binary.

    Parameters

    • path: string

      The path of the file to read.

    Returns Promise<Uint8Array>

readdir

  • readdir(path: string): string[]
  • Returns a list of entities contained in the specified path.

    Parameters

    • path: string

      The directory path to read.

    Returns string[]

readstr

  • readstr(path: string): Promise<string>
  • Reads the specified file as a string.

    Parameters

    • path: string

      The path of the file to read.

    Returns Promise<string>

rm

  • rm(path: string): Promise<boolean>
  • Deletes the specified file.

    Parameters

    • path: string

      The path of the file to remove.

    Returns Promise<boolean>

rmdir

  • rmdir(path: string): Promise<boolean>
  • Removes a directory and its contents.

    Parameters

    • path: string

      The path of the directory to remove.

    Returns Promise<boolean>

stat

  • Retrieves information about a file system entry.

    Parameters

    • path: string

      The path to retrieve information for.

    Returns Promise<FSBasicStat>

touch

  • touch(path: string): Promise<boolean>
  • Creates a new file.

    Parameters

    • path: string

      The path of the file to create.

    Returns Promise<boolean>

uninit

  • uninit(): Promise<void>
  • Called when the file system is being unmounted.

    Returns Promise<void>

writebin

  • writebin(path: string, data: Uint8Array | number[]): Promise<boolean>
  • Truncates and writes data to the specified file.

    Parameters

    • path: string

      The path of the file to write to.

    • data: Uint8Array | number[]

      The data to write.

    Returns Promise<boolean>

writestr

  • writestr(path: string, data: string): Promise<boolean>
  • Truncates and writes a UTF-8 encoded string to the specified file.

    Parameters

    • path: string

      The path of the file to write to.

    • data: string

      The string to write.

    Returns Promise<boolean>

Generated using TypeDoc