Options
All
  • Public
  • Public/Protected
  • All
Menu

fs-nextra

Index

Type aliases

BaseEncodingOptions

BaseEncodingOptions: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | null | undefined

BufferEncoding

BufferEncoding: "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"

CopyFilter

CopyFilter: (source: string, target: string) => boolean

Type declaration

    • (source: string, target: string): boolean
    • Parameters

      • source: string
      • target: string

      Returns boolean

SymLinkType

SymLinkType: "dir" | "file" | "junction"

The type of symlink you are creating:

  • dir
  • file
  • junction
memberof

fsn/nextra

Variables

Const emptydir

emptydir: emptyDir = emptyDir

Const ensureDir

ensureDir: mkdirs = mkdirs

Const ensureFile

ensureFile: createFile = createFile

Const ensureFileAtomic

ensureFileAtomic: createFileAtomic = createFileAtomic

Const ensureFileCopy

ensureFileCopy: createFileCopy = createFileCopy

Const ensureFileCopyAtomic

ensureFileCopyAtomic: createFileCopyAtomic = createFileCopyAtomic

Const ensureLink

ensureLink: createLink = createLink

Const ensureLinkAtomic

ensureLinkAtomic: createLinkAtomic = createLinkAtomic

Const ensureSymlink

ensureSymlink: createSymlink = createSymlink

Const ensureSymlinkAtomic

ensureSymlinkAtomic: createSymlinkAtomic = createSymlinkAtomic

Const mkdirp

mkdirp: mkdirs = mkdirs

Const outputJson

outputJson: outputJSON = outputJSON

Const outputJsonAtomic

outputJsonAtomic: outputJSONAtomic = outputJSONAtomic

Const readJson

readJson: readJSON = readJSON

Const writeJson

writeJson: writeJSON = writeJSON

Const writeJsonAtomic

writeJsonAtomic: writeJSONAtomic = writeJSONAtomic

Functions

copy

  • Copies files from one location to another, creating all directories required to satisfy the destination path.

    function

    copy

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path

    • destination: string

      The destination path

    • Default value options: CopyOptions | CopyFilter = {}

      Options for the copy, or a filter function

    Returns Promise<void>

copyDirectory

  • copyDirectory(mySource: string, stats: Stats, target: string, options: CopyData): Promise<void>
  • Parameters

    • mySource: string
    • stats: Stats
    • target: string
    • options: CopyData

    Returns Promise<void>

copyFileAtomic

  • copyFileAtomic(source: string, destination: string): Promise<void>
  • function

    copyFileAtomic

    memberof

    fsn/nextra

    Parameters

    • source: string

      The path to the file you want to copy

    • destination: string

      The path to the file destination

    Returns Promise<void>

copyOther

  • copyOther(mySource: string, stats: Stats, target: string, options: CopyData): Promise<void>
  • Parameters

    • mySource: string
    • stats: Stats
    • target: string
    • options: CopyData

    Returns Promise<void>

createFile

  • createFile(file: string, atomic?: boolean): Promise<void>
  • Creates an empty file, making all folders required to satisfy the given file path.

    function

    createFile

    memberof

    fsn/nextra

    Parameters

    • file: string

      Path of the file you want to create

    • Default value atomic: boolean = false

      Whether the operation should run atomically

    Returns Promise<void>

createFileAtomic

  • createFileAtomic(file: string): Promise<void>
  • Creates an file copy, making all folders required to satisfy the given file path atomically.

    function

    createFileAtomic

    memberof

    fsn/nextra

    Parameters

    • file: string

      Path of the file you want to create

    Returns Promise<void>

createFileCopy

  • createFileCopy(source: string, destination: string, atomic?: boolean): Promise<void>
  • Creates an file copy, making all folders required to satisfy the given file path.

    function

    createFileCopy

    memberof

    fsn/nextra

    Parameters

    • source: string

      The path to the file you want to copy

    • destination: string

      The path to the file destination

    • Default value atomic: boolean = false

      Whether the operation should run atomically

    Returns Promise<void>

createFileCopyAtomic

  • createFileCopyAtomic(source: string, destination: string): Promise<void>
  • Creates a file copy atomically, making all folders required to satisfy the given file path.

    function

    createFileCopyAtomic

    memberof

    fsn/nextra

    Parameters

    • source: string

      The path to the file you want to copy

    • destination: string

      The path to the file destination

    Returns Promise<void>

createLink

  • createLink(source: string, destination: string, atomic?: boolean): Promise<void>
  • Creates a hard file link, making all folders required to satisfy the given file path.

    function

    createLink

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    • Default value atomic: boolean = false

      Whether the operation should run atomically

    Returns Promise<void>

createLinkAtomic

  • createLinkAtomic(source: string, destination: string): Promise<void>
  • Creates a hard file link, making all folders required to satisfy the given file path atomically.

    function

    createLinkAtomic

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    Returns Promise<void>

createSymlink

  • createSymlink(source: string, destination: string, atomic?: undefined | false | true): Promise<void>
  • createSymlink(source: string, destination: string, type?: SymLinkType, atomic?: undefined | false | true): Promise<void>
  • Creates a soft file link, making all folders required to satisfy the given file path.

    function

    createSymlink

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    • Optional atomic: undefined | false | true

      Whether the operation should run atomically

    Returns Promise<void>

  • Parameters

    • source: string
    • destination: string
    • Optional type: SymLinkType
    • Optional atomic: undefined | false | true

    Returns Promise<void>

createSymlinkAtomic

  • createSymlinkAtomic(source: string, destination: string, type?: SymLinkType): Promise<void>
  • Creates a soft file link, making all folders required to satisfy the given file path atomically.

    function

    createSymlinkAtomic

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    • Optional type: SymLinkType

      The type of symlink you are creating

    Returns Promise<void>

emptyDir

  • emptyDir(dir: string): Promise<void>
  • Deletes all directories and files within the provided directory.

    function

    emptyDir

    memberof

    fsn/nextra

    Parameters

    • dir: string

      The directory you wish to empty

    Returns Promise<void>

fixWinEPERM

  • fixWinEPERM(myPath: string, options: RemoveOptions): Promise<void>

gunzip

  • gunzip(fileName: string, inputFile: string, atomic?: boolean): Promise<void>
  • Un-Gzips a file

    function

    gunzip

    memberof

    fsn/nextra

    Parameters

    • fileName: string

      The filename of the output file

    • inputFile: string

      The filepath of the archive

    • Default value atomic: boolean = false

      If the unzip file should be created atomically

    Returns Promise<void>

gunzipAtomic

  • gunzipAtomic(fileName: string, inputFile: string): Promise<void>
  • Un-Gzips a file atomically.

    function

    gunzipAtomic

    memberof

    fsn/nextra

    Parameters

    • fileName: string

      The filename of the output file

    • inputFile: string

      The filepath of the archive

    Returns Promise<void>

gzip

  • gzip(fileName: string, inputFile: string, atomic?: boolean): Promise<void>
  • Gzips a file

    function

    gzip

    memberof

    fsn/nextra

    Parameters

    • fileName: string

      The filename of the archive

    • inputFile: string

      The filepath of the input file

    • Default value atomic: boolean = false

      If the gzip file should be created

    Returns Promise<void>

gzipAtomic

  • gzipAtomic(fileName: string, inputFile: string): Promise<void>
  • Gzips a file atomically.

    function

    gzipAtomic

    memberof

    fsn/nextra

    Parameters

    • fileName: string

      The filename of the archive

    • inputFile: string

      The filepath of the input file

    Returns Promise<void>

isWritable

  • isWritable(myPath: string): Promise<boolean>

linkAtomic

  • linkAtomic(source: string, destination: string): Promise<void>
  • Creates a hard file link atomically.

    function

    linkAtomic

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    Returns Promise<void>

mkdirs

  • mkdirs(path: string, options?: MkdirsOptions | number): Promise<void>
  • Recursively makes directories, until the directory passed exists.

    function

    mkdirs

    memberof

    fsn/nextra

    Parameters

    • path: string

      The path you wish to make

    • Optional options: MkdirsOptions | number

      Options for making the directories

    Returns Promise<void>

move

  • move(source: string, destination: string, options?: MoveOptions): Promise<void>
  • function

    move

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    • Default value options: MoveOptions = {}

      The options for the move

    Returns Promise<void>

outputFile

  • outputFile(file: string, data: string | Buffer | Uint8Array, atomic?: undefined | false | true): Promise<void>
  • outputFile(file: string, data: string | Buffer | Uint8Array, options?: WriteOptions | BaseEncodingOptions, atomic?: undefined | false | true): Promise<void>
  • Writes a file to disk, creating all directories needed to meet the filepath provided.

    function

    outputFile

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • data: string | Buffer | Uint8Array

      The data to write to file

    • Optional atomic: undefined | false | true

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

outputFileAtomic

  • Writes a file to disk, creating all directories needed to meet the filepath provided atomically.

    function

    outputFileAtomic

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • data: string | Buffer | Uint8Array

      The data to write to file

    • Optional options: WriteOptions | BaseEncodingOptions

      The write options or the encoding string.

    Returns Promise<void>

outputJSON

  • outputJSON(file: string, data: any, atomic?: undefined | false | true): Promise<void>
  • outputJSON(file: string, data: any, options?: JsonOptions, atomic?: undefined | false | true): Promise<void>
  • Writes a json file to disk, creating all directories needed to meet the filepath provided.

    function

    outputJSON

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • data: any

      The data to write to file

    • Optional atomic: undefined | false | true

      If the operation should be done atomically

    Returns Promise<void>

  • Parameters

    • file: string
    • data: any
    • Optional options: JsonOptions
    • Optional atomic: undefined | false | true

    Returns Promise<void>

outputJSONAtomic

  • outputJSONAtomic(file: string, data: any, options?: JsonOptions): Promise<void>
  • Writes a json file to disk, creating all directories needed to meet the filepath provided atomically.

    function

    outputJSONAtomic

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • data: any

      The data to write to file

    • Optional options: JsonOptions

      The write options or the encoding string.

    Returns Promise<void>

pathExists

  • pathExists(path: string): Promise<boolean>
  • Checks if a path exists.

    function

    pathExists

    memberof

    fsn/nextra

    Parameters

    • path: string

      The path to check

    Returns Promise<boolean>

readJSON

  • Reads a file and parses it into a javascript object.

    function

    readJSON

    memberof

    fsn/nextra

    Parameters

    Returns Promise<any>

remove

  • Recursively deletes directories and files.

    function

    remove

    memberof

    fsn/nextra

    Parameters

    • path: string

      The path to remove

    • Default value options: RemoveOptions = {}

      The remove options

    Returns Promise<void>

removeDir

  • removeDir(myPath: string, options: RemoveOptions, originalEr?: null): Promise<void>

resolveCopyOptions

resolveOptions

rimraf

rmkids

scan

  • scan(root: string, options?: ScanOptions): Promise<Map<string, Dirent>>
  • Recursively scans a directory, returning a map of stats keyed on the full path to the item.

    function

    scan

    memberof

    fsn/nextra

    Parameters

    • root: string

      The path to scan

    • Default value options: ScanOptions = {}

      The options for the scan

    Returns Promise<Map<string, Dirent>>

scanDeep

  • scanDeep(path: string, results: Map<string, Dirent>, level: number, options: ScanOptions): Promise<Map<string, Dirent>>
  • Parameters

    • path: string
    • results: Map<string, Dirent>
    • level: number
    • options: ScanOptions

    Returns Promise<Map<string, Dirent>>

startCopy

  • startCopy(mySource: string, options: CopyData): Promise<void>

stripBom

  • stripBom(content: string | Buffer): string

symlinkAtomic

  • symlinkAtomic(source: string, destination: string, type?: SymLinkType): Promise<void>
  • Creates a soft file link atomically.

    function

    symlinkAtomic

    memberof

    fsn/nextra

    Parameters

    • source: string

      The source path of the file

    • destination: string

      The destination path of the file

    • Optional type: SymLinkType

      The type of symlink you are creating

    Returns Promise<void>

symlinkPaths

  • symlinkPaths(srcpath: string, dstPath: string): Promise<SymLinkPaths>

symlinkType

targz

  • targz(fileName: string, inputFiles: string | string[], atomic?: boolean): Promise<void>
  • Tar/Gzips a directory or array of files.

    function

    targz

    memberof

    fsn/nextra

    Parameters

    • fileName: string

      The filename of the archive

    • inputFiles: string | string[]

      The directory or array of filepaths to .tar.gz

    • Default value atomic: boolean = false

    Returns Promise<void>

targzAtomic

  • targzAtomic(fileName: string, inputFiles: string | string[]): Promise<void>
  • Tar/Gzips a directory or array of files.

    function

    targzAtomic

    memberof

    fsn/nextra

    Parameters

    • fileName: string

      The filename of the archive

    • inputFiles: string | string[]

      The directory or array of filepaths to .tar.gz

    Returns Promise<void>

unTargz

  • unTargz(outputDirectory: string, inputFile: string, atomic?: boolean): Promise<void>
  • Extracts files from .tar.gz archives.

    function

    unTargz

    memberof

    fsn/nextra

    Parameters

    • outputDirectory: string

      The directory to extract to

    • inputFile: string

      The archive file

    • Default value atomic: boolean = false

      The if the writes should be atomic

    Returns Promise<void>

unTargzAtomic

  • unTargzAtomic(outputDirectory: string, inputFile: string): Promise<void>
  • Extracts files from .tar.gz archives and writes them atomically.

    function

    unTargzAtomic

    memberof

    fsn/nextra

    Parameters

    • outputDirectory: string

      The directory to extract to

    • inputFile: string

      The archive file

    Returns Promise<void>

writeFileAtomic

  • function

    writeFileAtomic

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • data: string | Buffer | Uint8Array

      The data to write to file

    • Optional options: WriteOptions | BaseEncodingOptions

      The write options or the encoding string.

    Returns Promise<void>

writeJSON

  • writeJSON(file: string, object: any, atomic?: undefined | false | true): Promise<void>
  • writeJSON(file: string, object: any, options?: JsonOptions, atomic?: undefined | false | true): Promise<void>
  • Writes a Javascript Object to file as JSON.

    function

    writeJSON

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • object: any

      The javascript object you would like to write to file

    • Optional atomic: undefined | false | true

    Returns Promise<void>

  • Parameters

    • file: string
    • object: any
    • Optional options: JsonOptions
    • Optional atomic: undefined | false | true

    Returns Promise<void>

writeJSONAtomic

  • writeJSONAtomic(file: string, object: any, options?: JsonOptions): Promise<void>
  • Writes a Javascript Object to file as JSON atomically.

    function

    writeJSONAtomic

    memberof

    fsn/nextra

    Parameters

    • file: string

      The path to the file you want to create

    • object: any

      The javascript object you would like to write to file

    • Default value options: JsonOptions = {}

      The options to pass JSON.stringify and writeFile

    Returns Promise<void>

Generated using TypeDoc