Options
All
  • Public
  • Public/Protected
  • All
Menu

A collection of utilities related to the running process.

export

Hierarchy

  • ProcessUtils

Index

Methods

Static execAndCheckOutput

  • execAndCheckOutput(command: string, args?: string[], options?: SpawnSyncOptions): Buffer | string
  • Spawn a process with arguments and throw an error if the process fails. Parameters are same as child_process.spawnSync (see Node.js docs). Use this method if you want the safe argument parsing of spawnSync combined with the smart output handling of execSync.

    Parameters

    • command: string
    • Optional args: string[]
    • Optional options: SpawnSyncOptions

    Returns Buffer | string

    Contents of stdout as buffer or string

Static getBasicSystemInfo

Static isGuiAvailable

Static nextTick

  • nextTick(callback: (...args: any[]) => void, ...args: any[]): Promise<void>
  • Process utility to wrap callback process routines into promises Turn nextTick into a promise to prevent nesting

    static
    memberof

    ProcessUtils

    Parameters

    • callback: (...args: any[]) => void

      called before promise is resolved

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

          • Rest ...args: any[]

          Returns void

    • Rest ...args: any[]

      arguments passed to the callback

    Returns Promise<void>

    • fullfilled whenever callback is invoked

Static openInDefaultApp

  • openInDefaultApp(pathOrUrl: string): void
  • Open a file or URL in the default application associated with its file extension or URL protocol. This method is only supported in graphical environments.

    Parameters

    • pathOrUrl: string

      File path or Internet URL to open

    Returns void

Static openInEditor

  • openInEditor(filePath: string): Promise<void>
  • Open a file in the best editor that can be found in the current environment. In a graphical environment, the default application associated with its file extension will be launched. In a command-line environment, the file will be opened in vi, or the editor in the the {envVariablePrefix}_EDITOR environment variable if specified.

    Parameters

    • filePath: string

      File path to edit

    Returns Promise<void>

Generated using TypeDoc