Options
All
  • Public
  • Public/Protected
  • All
Menu

timestamp-nano

Index

Modules

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

BufferEncoding

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

CopyFilter

CopyFilter: function | RegExp

PartialObject

PartialObject: Partial<T>

SymlinkType

SymlinkType: "dir" | "file"

TouchOptionsLiteral

TouchOptionsLiteral: "-a" | "-c" | "-m" | "-d" | "-r"

touchOptionsArray

touchOptionsArray: object

Update the access and modification times of each FILE to the current time. A FILE argument that does not exist is created empty, unless -c is supplied

Type declaration

  • Optional -d?: string
  • Optional -r?: string

Variables

SlowBuffer

SlowBuffer: object

Type declaration

  • constructor: function
    • new __type(str: string, encoding?: string): Buffer
    • new __type(size: number): Buffer
    • new __type(size: Uint8Array): Buffer
    • new __type(array: any[]): Buffer
    • Parameters

      • str: string
      • Optional encoding: string

      Returns Buffer

    • Parameters

      • size: number

      Returns Buffer

    • Parameters

      • size: Uint8Array

      Returns Buffer

    • Parameters

      • array: any[]

      Returns Buffer

  • prototype: Buffer
  • byteLength: function
    • byteLength(string: string, encoding?: string): number
    • Parameters

      • string: string
      • Optional encoding: string

      Returns number

  • concat: function
    • Parameters

      • list: Buffer[]
      • Optional totalLength: number

      Returns Buffer

  • isBuffer: function
    • isBuffer(obj: any): boolean
    • Parameters

      • obj: any

      Returns boolean

Symbol

___dirname

___dirname: string

___filename

___filename: string

config

config: ShellConfig

The shelljs configuration.

type

{ShellConfig}

Export assignment console

console: Console

env

env: object

Object containing environment variables (both getter and setter). Shortcut to process.env.

Type declaration

  • [key: string]: string

exports

exports: any

global

global: Global

module

module: NodeModule

Export assignment process

process: Process
                                          *
              GLOBAL                      *
                                          *

require

require: NodeRequire

Functions

access

  • access(path: string | Buffer, callback: function): void
  • access(path: string | Buffer, mode: number, callback: function): void
  • access(path: string | Buffer, mode?: number): Promise<void>
  • Tests a user's permissions for the file specified by path.

    Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • Optional mode: number

    Returns Promise<void>

appendFile

  • appendFile(file: string | Buffer | number, data: any, options: object, callback: function): void
  • appendFile(file: string | Buffer | number, data: any, callback: function): void
  • appendFile(file: string | Buffer | number, data: any, options?: object): Promise<void>
  • Parameters

    • file: string | Buffer | number
    • data: any
    • options: object
      • Optional encoding?: string
      • Optional flag?: string
      • Optional mode?: number | string
    • callback: function

    Returns void

  • Parameters

    Returns void

  • Parameters

    • file: string | Buffer | number
    • data: any
    • Optional options: object
      • Optional encoding?: string
      • Optional flag?: string
      • Optional mode?: number | string

    Returns Promise<void>

cat

  • cat(...files: string[]): string
  • cat(files: string[]): string
  • Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.

    Parameters

    • Rest ...files: string[]

    Returns string

    A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).

  • Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.

    Parameters

    • files: string[]

      Files to use.

    Returns string

    A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).

cd

  • cd(dir: string): void
  • Changes to directory dir for the duration of the script

    Parameters

    • dir: string

      Directory to change in.

    Returns void

chmod

  • chmod(path: string | Buffer, mode: string | number, callback: function): void
  • chmod(path: string | Buffer, mode: string | number): Promise<void>
  • chmod(octalMode: number, file: string): void
  • chmod(mode: string, file: string): void
  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • mode: string | number

    Returns Promise<void>

  • Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:

    • In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
    • There is no "quiet" option since default behavior is to run silent.

    Parameters

    • octalMode: number

      The access mode. Octal.

    • file: string

      The file to use.

    Returns void

  • Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:

    • In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
    • There is no "quiet" option since default behavior is to run silent.

    Parameters

    • mode: string

      The access mode. Can be an octal string or a symbolic mode string.

    • file: string

      The file to use.

    Returns void

chown

  • chown(path: string | Buffer, uid: number, gid: number): Promise<void>
  • chown(path: string | Buffer, uid: number, gid: number, callback: function): void
  • Parameters

    • path: string | Buffer
    • uid: number
    • gid: number

    Returns Promise<void>

  • Parameters

    Returns void

clearImmediate

  • clearImmediate(immediateId: any): void
  • Parameters

    • immediateId: any

    Returns void

clearInterval

  • clearInterval(intervalId: Timer): void
  • Parameters

    Returns void

clearTimeout

  • clearTimeout(timeoutId: Timer): void
  • Parameters

    Returns void

close

  • close(fd: number, callback: function): void
  • close(fd: number): Promise<void>
  • Parameters

    Returns void

  • Parameters

    • fd: number

    Returns Promise<void>

copy

  • copy(src: string, dest: string, options?: CopyOptions): Promise<void>
  • copy(src: string, dest: string, callback: function): void
  • copy(src: string, dest: string, options: CopyOptions, callback: function): void
  • Parameters

    • src: string
    • dest: string
    • Optional options: CopyOptions

    Returns Promise<void>

  • Parameters

    • src: string
    • dest: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • src: string
    • dest: string
    • options: CopyOptions
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

copySync

  • copySync(src: string, dest: string, options?: CopyOptions): void
  • Parameters

    • src: string
    • dest: string
    • Optional options: CopyOptions

    Returns void

cp

  • cp(source: string, dest: string): void
  • cp(source: string[], dest: string): void
  • cp(options: string, source: string, dest: string): void
  • cp(options: string, source: string[], dest: string): void
  • Copies files. The wildcard * is accepted.

    Parameters

    • source: string

      The source.

    • dest: string

      The destination.

    Returns void

  • Copies files. The wildcard * is accepted.

    Parameters

    • source: string[]

      The source.

    • dest: string

      The destination.

    Returns void

  • Copies files. The wildcard * is accepted.

    Parameters

    • options: string

      Available options: -f (force), -r, -R (recursive)

    • source: string

      The source.

    • dest: string

      The destination.

    Returns void

  • Copies files. The wildcard * is accepted.

    Parameters

    • options: string

      Available options: -f (force), -r, -R (recursive)

    • source: string[]

      The source.

    • dest: string

      The destination.

    Returns void

createFile

  • createFile(file: string): Promise<void>
  • createFile(file: string, callback: function): void
  • Parameters

    • file: string

    Returns Promise<void>

  • Parameters

    • file: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

createFileSync

  • createFileSync(file: string): void
  • Parameters

    • file: string

    Returns void

dirs

  • dirs(options: "-c"): string[]
  • dirs(options: "+N"): string
  • dirs(options: "-N"): string
  • dirs(options: string): any
  • Clears the directory stack by deleting all of the elements.

    Parameters

    • options: "-c"

      Clears the directory stack by deleting all of the elements.

    Returns string[]

    Returns an array of paths in the stack, or a single path if +N or -N was specified.

  • Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.

    Parameters

    • options: "+N"

      Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.

    Returns string

    Returns an array of paths in the stack, or a single path if +N or -N was specified.

  • Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.

    Parameters

    • options: "-N"

      Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.

    Returns string

    Returns an array of paths in the stack, or a single path if +N or -N was specified.

  • Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.

    Parameters

    • options: string

      Available options: -c, -N, +N. You can only use those.

    Returns any

    Returns an array of paths in the stack, or a single path if +N or -N was specified.

echo

  • echo(...text: string[]): string
  • Prints string to stdout, and returns string with additional utility methods like .to().

    Parameters

    • Rest ...text: string[]

    Returns string

    Returns the string that was passed as argument.

emptyDir

  • emptyDir(path: string): Promise<void>
  • emptyDir(path: string, callback: function): void
  • Parameters

    • path: string

    Returns Promise<void>

  • Parameters

    • path: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

emptyDirSync

  • emptyDirSync(path: string): void
  • Parameters

    • path: string

    Returns void

ensureDir

  • ensureDir(path: string): Promise<void>
  • ensureDir(path: string, callback: function): void
  • Parameters

    • path: string

    Returns Promise<void>

  • Parameters

    • path: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

ensureDirSync

  • ensureDirSync(path: string): void
  • Parameters

    • path: string

    Returns void

ensureFile

  • ensureFile(path: string): Promise<void>
  • ensureFile(path: string, callback: function): void
  • Parameters

    • path: string

    Returns Promise<void>

  • Parameters

    • path: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

ensureFileSync

  • ensureFileSync(path: string): void
  • Parameters

    • path: string

    Returns void

ensureLink

  • ensureLink(src: string, dest: string): Promise<void>
  • ensureLink(src: string, dest: string, callback: function): void
  • Parameters

    • src: string
    • dest: string

    Returns Promise<void>

  • Parameters

    • src: string
    • dest: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

ensureLinkSync

  • ensureLinkSync(src: string, dest: string): void
  • Parameters

    • src: string
    • dest: string

    Returns void

ensureSymlink

  • ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>
  • ensureSymlink(src: string, dest: string, type: SymlinkType, callback: function): void
  • ensureSymlink(src: string, dest: string, callback: function): void
  • Parameters

    Returns Promise<void>

  • Parameters

    • src: string
    • dest: string
    • type: SymlinkType
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • src: string
    • dest: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

ensureSymlinkSync

  • ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void
  • Parameters

    Returns void

error

  • error(): string
  • Tests if error occurred in the last command.

    Returns string

    Returns null if no error occurred, otherwise returns string explaining the error

exec

  • Executes the given command synchronously.

    Parameters

    • command: string

      The command to execute.

    Returns ExecOutputReturnValue

    Returns an object containing the return code and output as string.

  • Executes the given command synchronously.

    Parameters

    • command: string

      The command to execute.

    • options: ExecOptions

      Silence and synchronous options.

    Returns ExecOutputReturnValue | ChildProcess

    Returns an object containing the return code and output as string, or if {async:true} was passed, a ChildProcess.

  • Executes the given command synchronously.

    Parameters

    • command: string

      The command to execute.

    • options: ExecOptions

      Silence and synchronous options.

    • callback: ExecCallback

      Receives code and output asynchronously.

    Returns ChildProcess

  • Executes the given command synchronously.

    Parameters

    • command: string

      The command to execute.

    • callback: ExecCallback

      Receives code and output asynchronously.

    Returns ChildProcess

exit

  • exit(code: number): void
  • Exits the current process with the given exit code.

    Parameters

    • code: number

      The exit code.

    Returns void

fchmod

  • fchmod(fd: number, mode: string | number, callback: function): void
  • fchmod(fd: number, mode: string | number): Promise<void>
  • Parameters

    Returns void

  • Parameters

    • fd: number
    • mode: string | number

    Returns Promise<void>

fchown

  • fchown(fd: number, uid: number, gid: number, callback: function): void
  • fchown(fd: number, uid: number, gid: number): Promise<void>
  • Parameters

    Returns void

  • Parameters

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

    Returns Promise<void>

fdatasync

  • fdatasync(fd: number, callback: function): void
  • fdatasync(fd: number): Promise<void>
  • Parameters

    • fd: number
    • callback: function
        • (): void
        • Returns void

    Returns void

  • Parameters

    • fd: number

    Returns Promise<void>

find

  • find(...path: string[]): string[]
  • find(path: string[]): string[]
  • Returns array of all files (however deep) in the given paths.

    Parameters

    • Rest ...path: string[]

    Returns string[]

    An array of all files (however deep) in the given path(s).

  • Returns array of all files (however deep) in the given paths.

    Parameters

    • path: string[]

      The path(s) to search.

    Returns string[]

    An array of all files (however deep) in the given path(s).

fstat

  • fstat(fd: number, callback: function): void
  • fstat(fd: number): Promise<Stats>
  • Parameters

    Returns void

  • Parameters

    • fd: number

    Returns Promise<Stats>

fsync

  • fsync(fd: number, callback: function): void
  • fsync(fd: number): Promise<void>
  • Parameters

    Returns void

  • Parameters

    • fd: number

    Returns Promise<void>

ftruncate

  • ftruncate(fd: number, callback: function): void
  • ftruncate(fd: number, len: number, callback: function): void
  • ftruncate(fd: number, len?: number): Promise<void>
  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • fd: number
    • Optional len: number

    Returns Promise<void>

futimes

  • futimes(fd: number, atime: number, mtime: number, callback: function): void
  • futimes(fd: number, atime: Date, mtime: Date, callback: function): void
  • futimes(fd: number, atime: number, mtime: number): Promise<void>
  • futimes(fd: number, atime: Date, mtime: Date): Promise<void>
  • Parameters

    • fd: number
    • atime: number
    • mtime: number
    • callback: function

    Returns void

  • Parameters

    Returns void

  • Parameters

    • fd: number
    • atime: number
    • mtime: number

    Returns Promise<void>

  • Parameters

    • fd: number
    • atime: Date
    • mtime: Date

    Returns Promise<void>

grep

  • grep(regex_filter: RegExp, ...files: string[]): string
  • grep(regex_filter: RegExp, files: string[]): string
  • grep(options: string, regex_filter: string, ...files: string[]): string
  • grep(options: string, regex_filter: string, files: string[]): string
  • Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.

    Parameters

    • regex_filter: RegExp

      The regular expression to use.

    • Rest ...files: string[]

    Returns string

    Returns a string containing all lines of the file that match the given regex_filter.

  • Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.

    Parameters

    • regex_filter: RegExp

      The regular expression to use.

    • files: string[]

    Returns string

    Returns a string containing all lines of the file that match the given regex_filter.

  • Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.

    Parameters

    • options: string

      Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)

    • regex_filter: string

      The regular expression to use.

    • Rest ...files: string[]

    Returns string

    Returns a string containing all lines of the file that match the given regex_filter.

  • Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.

    Parameters

    • options: string

      Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)

    • regex_filter: string

      The regular expression to use.

    • files: string[]

      The files to process.

    Returns string

    Returns a string containing all lines of the file that match the given regex_filter.

lchown

  • lchown(path: string | Buffer, uid: number, gid: number, callback: function): void
  • lchown(path: string | Buffer, uid: number, gid: number): Promise<void>
  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • uid: number
    • gid: number

    Returns Promise<void>

link

  • link(srcpath: string | Buffer, dstpath: string | Buffer, callback: function): void
  • link(srcpath: string | Buffer, dstpath: string | Buffer): Promise<void>
  • Parameters

    Returns void

  • Parameters

    Returns Promise<void>

ln

  • ln(source: string, dest: string): void
  • ln(options: string, source: string, dest: string): void
  • Links source to dest. Use -f to force the link, should dest already exist.

    Parameters

    • source: string

      The source.

    • dest: string

      The destination.

    Returns void

  • Links source to dest. Use -f to force the link, should dest already exist.

    Parameters

    • options: string

      Available options: s (symlink), f (force)

    • source: string

      The source.

    • dest: string

      The destination.

    Returns void

ls

  • ls(...paths: string[]): string[]
  • ls(options: string, ...paths: string[]): string[]
  • ls(paths: string[]): string[]
  • ls(options: string, paths: string[]): string[]
  • Returns array of files in the given path, or in current directory if no path provided.

    Parameters

    • Rest ...paths: string[]

    Returns string[]

    An array of files in the given path(s).

  • Returns array of files in the given path, or in current directory if no path provided.

    Parameters

    • options: string

      Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)

    • Rest ...paths: string[]

    Returns string[]

    An array of files in the given path(s).

  • Returns array of files in the given path, or in current directory if no path provided.

    Parameters

    • paths: string[]

      Paths to search.

    Returns string[]

    An array of files in the given path(s).

  • Returns array of files in the given path, or in current directory if no path provided.

    Parameters

    • options: string

      Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)

    • paths: string[]

      Paths to search.

    Returns string[]

    An array of files in the given path(s).

lstat

  • lstat(path: string | Buffer, callback: function): void
  • lstat(path: string | Buffer): Promise<Stats>
  • Parameters

    Returns void

  • Parameters

    Returns Promise<Stats>

mkdir

  • mkdir(path: string | Buffer, callback: function): void
  • mkdir(path: string | Buffer, mode: number | string, callback: function): void
  • mkdir(path: string | Buffer): Promise<void>
  • mkdir(...dir: string[]): void
  • mkdir(dir: string[]): void
  • mkdir(options: string, ...dir: string[]): void
  • mkdir(options: string, dir: string[]): void
  • Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.

    Parameters

    • path: string | Buffer
    • callback: function

      No arguments other than a possible exception are given to the completion callback.

    Returns void

  • Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.

    Parameters

    • path: string | Buffer
    • mode: number | string
    • callback: function

      No arguments other than a possible exception are given to the completion callback.

    Returns void

  • Parameters

    Returns Promise<void>

  • Creates directories.

    Parameters

    • Rest ...dir: string[]

    Returns void

  • Creates directories.

    Parameters

    • dir: string[]

      Directories to create.

    Returns void

  • Creates directories.

    Parameters

    • options: string

      Available options: p (full paths, will create intermediate dirs if necessary)

    • Rest ...dir: string[]

    Returns void

  • Creates directories.

    Parameters

    • options: string

      Available options: p (full paths, will create intermediate dirs if necessary)

    • dir: string[]

      The directories to create.

    Returns void

mkdirp

  • mkdirp(dir: string): Promise<void>
  • mkdirp(dir: string, callback: function): void
  • Parameters

    • dir: string

    Returns Promise<void>

  • Parameters

    • dir: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

mkdirpSync

  • mkdirpSync(dir: string): void
  • Parameters

    • dir: string

    Returns void

mkdirs

  • mkdirs(dir: string): Promise<void>
  • mkdirs(dir: string, callback: function): void
  • Parameters

    • dir: string

    Returns Promise<void>

  • Parameters

    • dir: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

mkdirsSync

  • mkdirsSync(dir: string): void
  • Parameters

    • dir: string

    Returns void

mkdtemp

  • mkdtemp(prefix: string): Promise<string>
  • mkdtemp(prefix: string, callback: function): void
  • Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.

    Parameters

    • prefix: string

    Returns Promise<string>

  • Parameters

    Returns void

move

  • move(src: string, dest: string, options?: MoveOptions): Promise<void>
  • move(src: string, dest: string, callback: function): void
  • move(src: string, dest: string, options: MoveOptions, callback: function): void
  • Parameters

    • src: string
    • dest: string
    • Optional options: MoveOptions

    Returns Promise<void>

  • Parameters

    • src: string
    • dest: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • src: string
    • dest: string
    • options: MoveOptions
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

moveSync

  • moveSync(src: string, dest: string, options?: MoveOptions): void
  • Parameters

    • src: string
    • dest: string
    • Optional options: MoveOptions

    Returns void

mv

  • mv(source: string, dest: string): void
  • mv(source: string[], dest: string): void
  • Moves files. The wildcard * is accepted.

    Parameters

    • source: string

      The source.

    • dest: string

      The destination.

    Returns void

  • Moves files. The wildcard * is accepted.

    Parameters

    • source: string[]

      The source.

    • dest: string

      The destination.

    Returns void

open

  • open(path: string | Buffer, flags: string | number, callback: function): void
  • open(path: string | Buffer, flags: string | number, mode: number, callback: function): void
  • open(path: string | Buffer, flags: string | number, mode?: number): Promise<number>
  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • flags: string | number
    • mode: number
    • callback: function

    Returns void

  • Parameters

    • path: string | Buffer
    • flags: string | number
    • Optional mode: number

    Returns Promise<number>

outputFile

  • outputFile(file: string, data: any): Promise<void>
  • outputFile(file: string, data: any, callback: function): void
  • Parameters

    • file: string
    • data: any

    Returns Promise<void>

  • Parameters

    • file: string
    • data: any
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

outputFileSync

  • outputFileSync(file: string, data: any): void
  • Parameters

    • file: string
    • data: any

    Returns void

outputJSON

  • outputJSON(file: string, data: any, options?: WriteOptions): Promise<void>
  • outputJSON(file: string, data: any, options: WriteOptions, callback: function): void
  • outputJSON(file: string, data: any, callback: function): void
  • Parameters

    Returns Promise<void>

  • Parameters

    • file: string
    • data: any
    • options: WriteOptions
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • file: string
    • data: any
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

outputJSONSync

  • outputJSONSync(file: string, data: any, options?: WriteOptions): void
  • Parameters

    Returns void

outputJson

  • outputJson(file: string, data: any, options?: WriteOptions): Promise<void>
  • outputJson(file: string, data: any, options: WriteOptions, callback: function): void
  • outputJson(file: string, data: any, callback: function): void
  • Parameters

    Returns Promise<void>

  • Parameters

    • file: string
    • data: any
    • options: WriteOptions
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • file: string
    • data: any
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

outputJsonSync

  • outputJsonSync(file: string, data: any, options?: WriteOptions): void
  • Parameters

    Returns void

pathExists

  • pathExists(path: string): Promise<boolean>
  • pathExists(path: string, callback: function): void
  • Parameters

    • path: string

    Returns Promise<boolean>

  • Parameters

    • path: string
    • callback: function
        • (err: Error, exists: boolean): void
        • Parameters

          • err: Error
          • exists: boolean

          Returns void

    Returns void

pathExistsSync

  • pathExistsSync(path: string): boolean
  • Parameters

    • path: string

    Returns boolean

popd

  • popd(dir: "+N"): string[]
  • popd(): string[]
  • popd(dir: "-N"): string[]
  • popd(dir: string): string[]
  • popd(options: string, dir: "+N"): string[]
  • popd(options: string, dir: "-N"): string[]
  • popd(options: string, dir: string): string[]
  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Parameters

    • dir: "+N"

      Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.

    Returns string[]

    Returns an array of paths in the stack.

  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Returns string[]

    Returns an array of paths in the stack.

  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Parameters

    • dir: "-N"

      Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.

    Returns string[]

    Returns an array of paths in the stack.

  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Parameters

    • dir: string

      You can only use -N and +N.

    Returns string[]

    Returns an array of paths in the stack.

  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Parameters

    • options: string

      Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated)

    • dir: "+N"

      Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.

    Returns string[]

    Returns an array of paths in the stack.

  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Parameters

    • options: string

      Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated)

    • dir: "-N"

      Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.

    Returns string[]

    Returns an array of paths in the stack.

  • When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.

    Parameters

    • options: string

      Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated)

    • dir: string

      You can only use -N and +N.

    Returns string[]

    Returns an array of paths in the stack.

pushd

  • pushd(dir: "+N"): string[]
  • pushd(dir: "-N"): string[]
  • pushd(dir: string): string[]
  • pushd(options: string, dir: "+N"): string[]
  • pushd(options: string, dir: "-N"): string[]
  • pushd(options: string, dir: string): string[]
  • Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.

    Parameters

    • dir: "+N"

      Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.

    Returns string[]

    Returns an array of paths in the stack.

  • Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.

    Parameters

    • dir: "-N"

      Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.

    Returns string[]

    Returns an array of paths in the stack.

  • Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.

    Parameters

    • dir: string

      Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.

    Returns string[]

    Returns an array of paths in the stack.

  • Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.

    Parameters

    • options: string

      Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)

    • dir: "+N"

      Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.

    Returns string[]

    Returns an array of paths in the stack.

  • Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.

    Parameters

    • options: string

      Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)

    • dir: "-N"

      Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.

    Returns string[]

    Returns an array of paths in the stack.

  • Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.

    Parameters

    • options: string

      Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)

    • dir: string

      Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.

    Returns string[]

    Returns an array of paths in the stack.

pwd

  • pwd(): string
  • Returns the current directory.

    Returns string

    The current directory.

read

  • read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: function): void
  • read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): Promise<ReadResult>
  • Parameters

    • fd: number
    • buffer: Buffer
    • offset: number
    • length: number
    • position: number | null
    • callback: function

    Returns void

  • Parameters

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

    Returns Promise<ReadResult>

readFile

  • readFile(file: string | Buffer | number, callback: function): void
  • readFile(file: string | Buffer | number, encoding: string, callback: function): void
  • readFile(file: string | Buffer | number, options: object | object, callback: function): void
  • readFile(file: string | Buffer | number, options: object | object): Promise<string>
  • readFile(file: string | Buffer | number, encoding: string): Promise<string>
  • readFile(file: string | Buffer | number): Promise<Buffer>
  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • file: string | Buffer | number
    • options: object | object

    Returns Promise<string>

  • Parameters

    • file: string | Buffer | number
    • encoding: string

    Returns Promise<string>

  • Parameters

    • file: string | Buffer | number

    Returns Promise<Buffer>

readJSON

  • readJSON(file: string, options?: ReadOptions): Promise<any>
  • readJSON(file: string, callback: function): void
  • readJSON(file: string, options: ReadOptions, callback: function): void
  • Parameters

    Returns Promise<any>

  • Parameters

    • file: string
    • callback: function
        • (err: Error, jsonObject: any): void
        • Parameters

          • err: Error
          • jsonObject: any

          Returns void

    Returns void

  • Parameters

    • file: string
    • options: ReadOptions
    • callback: function
        • (err: Error, jsonObject: any): void
        • Parameters

          • err: Error
          • jsonObject: any

          Returns void

    Returns void

readJSONSync

  • readJSONSync(file: string, options?: ReadOptions): any
  • Parameters

    Returns any

readJson

  • readJson(file: string, options?: ReadOptions): Promise<any>
  • readJson(file: string, callback: function): void
  • readJson(file: string, options: ReadOptions, callback: function): void
  • Parameters

    Returns Promise<any>

  • Parameters

    • file: string
    • callback: function
        • (err: Error, jsonObject: any): void
        • Parameters

          • err: Error
          • jsonObject: any

          Returns void

    Returns void

  • Parameters

    • file: string
    • options: ReadOptions
    • callback: function
        • (err: Error, jsonObject: any): void
        • Parameters

          • err: Error
          • jsonObject: any

          Returns void

    Returns void

readJsonSync

  • readJsonSync(file: string, options?: ReadOptions): any
  • Parameters

    Returns any

readdir

  • readdir(path: string | Buffer, callback: function): void
  • readdir(path: string | Buffer): Promise<string[]>
  • Parameters

    Returns void

  • Parameters

    Returns Promise<string[]>

readlink

  • readlink(path: string | Buffer, callback: function): void
  • readlink(path: string | Buffer): Promise<string>
  • Parameters

    Returns void

  • Parameters

    Returns Promise<string>

realpath

  • realpath(path: string | Buffer, callback: function): void
  • realpath(path: string | Buffer, cache: object, callback: function): void
  • realpath(path: string | Buffer, cache?: object): Promise<string>
  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • cache: object
      • [path: string]: string
    • callback: function

    Returns void

  • Parameters

    • path: string | Buffer
    • Optional cache: object
      • [path: string]: string

    Returns Promise<string>

remove

  • remove(dir: string): Promise<void>
  • remove(dir: string, callback: function): void
  • Parameters

    • dir: string

    Returns Promise<void>

  • Parameters

    • dir: string
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

removeSync

  • removeSync(dir: string): void
  • Parameters

    • dir: string

    Returns void

rename

  • rename(oldPath: string, newPath: string, callback: function): void
  • rename(oldPath: string, newPath: string): Promise<void>
  • Parameters

    Returns void

  • Parameters

    • oldPath: string
    • newPath: string

    Returns Promise<void>

rm

  • rm(...files: string[]): void
  • rm(files: string[]): void
  • rm(options: string, ...files: string[]): void
  • rm(options: string, files: string[]): void
  • Removes files. The wildcard * is accepted.

    Parameters

    • Rest ...files: string[]

    Returns void

  • Removes files. The wildcard * is accepted.

    Parameters

    • files: string[]

      Files to remove.

    Returns void

  • Removes files. The wildcard * is accepted.

    Parameters

    • options: string

      Available options: -f (force), -r, -R (recursive)

    • Rest ...files: string[]

    Returns void

  • Removes files. The wildcard * is accepted.

    Parameters

    • options: string

      Available options: -f (force), -r, -R (recursive)

    • files: string[]

    Returns void

rmdir

  • rmdir(path: string | Buffer, callback: function): void
  • rmdir(path: string | Buffer): Promise<void>
  • Asynchronous rmdir - removes the directory specified in {path}

    Parameters

    • path: string | Buffer
    • callback: function

      No arguments other than a possible exception are given to the completion callback.

    Returns void

  • Parameters

    Returns Promise<void>

sed

  • sed(searchRegex: RegExp, replacement: string, file: string): string
  • sed(searchRegex: string, replacement: string, file: string): string
  • sed(options: string, searchRegex: RegExp, replacement: string, file: string): string
  • sed(options: string, searchRegex: string, replacement: string, file: string): string
  • Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.

    Parameters

    • searchRegex: RegExp

      The regular expression to use for search.

    • replacement: string

      The replacement.

    • file: string

      The file to process.

    Returns string

    The new string after replacement.

  • Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.

    Parameters

    • searchRegex: string

      The regular expression to use for search.

    • replacement: string

      The replacement.

    • file: string

      The file to process.

    Returns string

    The new string after replacement.

  • Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.

    Parameters

    • options: string

      Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)

    • searchRegex: RegExp

      The regular expression to use for search.

    • replacement: string

      The replacement.

    • file: string

      The file to process.

    Returns string

    The new string after replacement.

  • Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.

    Parameters

    • options: string

      Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)

    • searchRegex: string

      The regular expression to use for search.

    • replacement: string

      The replacement.

    • file: string

      The file to process.

    Returns string

    The new string after replacement.

setInterval

  • setInterval(callback: function, ms: number, ...args: any[]): Timer
  • Parameters

    • callback: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • ms: number
    • Rest ...args: any[]

    Returns Timer

stat

  • stat(path: string | Buffer, callback: function): void
  • stat(path: string | Buffer): Promise<Stats>
  • Parameters

    Returns void

  • Parameters

    Returns Promise<Stats>

symlink

  • symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: function): void
  • symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): Promise<void>
  • Parameters

    Returns void

  • Parameters

    • srcpath: string | Buffer
    • dstpath: string | Buffer
    • Optional type: string

    Returns Promise<void>

tempdir

  • tempdir(): string
  • Searches and returns string containing a writeable, platform-dependent temporary directory. Follows Python's tempfile algorithm.

    Returns string

    The temp file path.

test

  • test(option: string, path: string): boolean
  • Evaluates expression using the available primaries and returns corresponding value.

    Parameters

    • option: string

      '-b': true if path is a block device; '-c': true if path is a character device; '-d': true if path is a directory; '-e': true if path exists; '-f': true if path is a regular file; '-L': true if path is a symboilc link; '-p': true if path is a pipe (FIFO); '-S': true if path is a socket

    • path: string

      The path.

    Returns boolean

    See option parameter.

touch

  • Parameters

    • Rest ...files: string[]

    Returns void

  • Parameters

    • files: string[]

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

truncate

  • truncate(path: string | Buffer, callback: function): void
  • truncate(path: string | Buffer, len: number, callback: function): void
  • truncate(path: string | Buffer, len?: number): Promise<void>
  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • Optional len: number

    Returns Promise<void>

unlink

  • unlink(path: string | Buffer, callback: function): void
  • unlink(path: string | Buffer): Promise<void>
  • Asynchronous unlink - deletes the file specified in {path}

    Parameters

    • path: string | Buffer
    • callback: function

      No arguments other than a possible exception are given to the completion callback.

    Returns void

  • Parameters

    Returns Promise<void>

utimes

  • utimes(path: string | Buffer, atime: number, mtime: number, callback: function): void
  • utimes(path: string | Buffer, atime: Date, mtime: Date, callback: function): void
  • utimes(path: string | Buffer, atime: number, mtime: number): Promise<void>
  • utimes(path: string | Buffer, atime: Date, mtime: Date): Promise<void>
  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • path: string | Buffer
    • atime: number
    • mtime: number

    Returns Promise<void>

  • Parameters

    • path: string | Buffer
    • atime: Date
    • mtime: Date

    Returns Promise<void>

which

  • which(command: string): string
  • Searches for command in the system's PATH. On Windows looks for .exe, .cmd, and .bat extensions.

    Parameters

    • command: string

      The command to search for.

    Returns string

    Returns string containing the absolute path to the command.

write

  • write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: function): void
  • write(fd: number, buffer: Buffer, offset: number, length: number, callback: function): void
  • write(fd: number, data: any, callback: function): void
  • write(fd: number, data: any, offset: number, callback: function): void
  • write(fd: number, data: any, offset: number, encoding: string, callback: function): void
  • write(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): Promise<WriteResult>
  • write(fd: number, data: any, offset: number, encoding?: string): Promise<WriteResult>
  • Parameters

    • fd: number
    • buffer: Buffer
    • offset: number
    • length: number
    • position: number | null
    • callback: function

    Returns void

  • Parameters

    Returns void

  • Parameters

    • fd: number
    • data: any
    • callback: function

    Returns void

  • Parameters

    • fd: number
    • data: any
    • offset: number
    • callback: function

    Returns void

  • Parameters

    • fd: number
    • data: any
    • offset: number
    • encoding: string
    • callback: function

    Returns void

  • Parameters

    • fd: number
    • buffer: Buffer
    • offset: number
    • length: number
    • Optional position: number | null

    Returns Promise<WriteResult>

  • Parameters

    • fd: number
    • data: any
    • offset: number
    • Optional encoding: string

    Returns Promise<WriteResult>

writeFile

  • writeFile(file: string | Buffer | number, data: any, callback: function): void
  • writeFile(file: string | Buffer | number, data: any, options?: object): Promise<void>
  • writeFile(file: string | Buffer | number, data: any, options: object, callback: function): void
  • Parameters

    Returns void

  • Parameters

    • file: string | Buffer | number
    • data: any
    • Optional options: object
      • Optional encoding?: string
      • Optional flag?: string
      • Optional mode?: number

    Returns Promise<void>

  • Parameters

    • file: string | Buffer | number
    • data: any
    • options: object
      • Optional encoding?: string
      • Optional flag?: string
      • Optional mode?: number
    • callback: function

    Returns void

writeJSON

  • writeJSON(file: string, object: any, options?: WriteOptions): Promise<void>
  • writeJSON(file: string, object: any, callback: function): void
  • writeJSON(file: string, object: any, options: WriteOptions, callback: function): void
  • Parameters

    Returns Promise<void>

  • Parameters

    • file: string
    • object: any
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • file: string
    • object: any
    • options: WriteOptions
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

writeJSONSync

  • writeJSONSync(file: string, object: any, options?: WriteOptions): void
  • Parameters

    Returns void

writeJson

  • writeJson(file: string, object: any, options?: WriteOptions): Promise<void>
  • writeJson(file: string, object: any, callback: function): void
  • writeJson(file: string, object: any, options: WriteOptions, callback: function): void
  • Parameters

    Returns Promise<void>

  • Parameters

    • file: string
    • object: any
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • Parameters

    • file: string
    • object: any
    • options: WriteOptions
    • callback: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

writeJsonSync

  • writeJsonSync(file: string, object: any, options?: WriteOptions): void
  • Parameters

    Returns void

Generated using TypeDoc