Options
All
  • Public
  • Public/Protected
  • All
Menu

typescript-starter

Index

Type aliases

TypescriptStarterArgsOptions

TypescriptStarterUserOptions

Functions

Const addInferredOptions

asyncABC

  • asyncABC(): Promise<ReadonlyArray<string>>
  • A sample async function (to demo Typescript's es7 async/await downleveling).

    Example (es imports)

    import { asyncABC } from 'typescript-starter'
    console.log(await asyncABC())
    // => ['a','b','c']

    Example (commonjs)

    var double = require('typescript-starter').asyncABC;
    asyncABC().then(console.log);
    // => ['a','b','c']

    Returns Promise<ReadonlyArray<string>>

    a Promise which should contain ['a','b','c']

checkArgs

Const cloneRepo

  • cloneRepo(spawner: object, suppressOutput?: boolean): (Anonymous function)
  • Parameters

    • spawner: object
        • (file: string, arguments?: keyof string[], options?: execa.Options): execa.ExecaChildProcess
        • (file: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • (file: string, options?: execa.Options): execa.ExecaChildProcess
        • (file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a file.

          Think of this as a mix of child_process.execFile and child_process.spawn.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa('echo', ['unicorns']);
          console.log(stdout);
          //=> 'unicorns'
          
          // Cancelling a spawned process
          const subprocess = execa('node');
          setTimeout(() => { spawned.cancel() }, 1000);
          try {
          await subprocess;
          } catch (error) {
          console.log(subprocess.killed); // true
          console.log(error.isCanceled); // true
          }
          })();
          
          // Pipe the child process stdout to the current stdout
          execa('echo', ['unicorns']).stdout.pipe(process.stdout);

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • file: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • command: function
        • command(command: string, options?: execa.Options): execa.ExecaChildProcess
        • command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Same as execa() except both file and arguments are specified in a single command string. For example, execa('echo', ['unicorns']) is the same as execa.command('echo unicorns').

          If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if command is not a constant but a variable, for example with __dirname or process.cwd(). Except for spaces, no escaping/quoting is needed.

          The shell option must be used if the command uses shell-specific features, as opposed to being a simple file followed by its arguments.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa.command('echo unicorns');
          console.log(stdout);
          //=> 'unicorns'
          })();

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • commandSync: function
        • commandSync(command: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • commandSync(command: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Same as execa.command() but synchronous.

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

      • node: function
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.NodeOptions): execa.ExecaChildProcess
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess
        • node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a Node.js script as a child process.

          Same as execa('node', [scriptPath, ...arguments], options) except (like child_process#fork()):

          • the current Node version and options are used. This can be overridden using the nodePath and nodeArguments options.
          • the shell option cannot be used
          • an extra channel ipc is passed to stdio

          Parameters

          • scriptPath: string

            Node.js script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to scriptPath on execution.

          • Optional options: execa.NodeOptions

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • scriptPath: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • sync: function
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • sync(file: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Execute a file synchronously.

          This method throws an Error if the command fails.

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

    • Default value suppressOutput: boolean = false

    Returns (Anonymous function)

double

  • double(value: number): number
  • Multiplies a value by 2. (Also a full example of Typedoc's functionality.)

    Example (es module)

    import { double } from 'typescript-starter'
    console.log(double(4))
    // => 8

    Example (commonjs)

    var double = require('typescript-starter').double;
    console.log(double(4))
    // => 8
    anothernote

    Some other value.

    Parameters

    • value: number

      Comment describing the value parameter.

    Returns number

    Comment describing the return type.

Const getGithubUsername

  • getGithubUsername(fetcher: any): (Anonymous function)
  • Parameters

    • fetcher: any

    Returns (Anonymous function)

getIntro

  • getIntro(columns: number | undefined): string
  • Parameters

    • columns: number | undefined

    Returns string

Const getRepoInfo

  • getRepoInfo(starterVersion: string): object
  • Returns the URL and branch to clone. We clone the branch (tag) at the current release rather than master. This ensures we get the exact files expected by this version of the CLI. (If we cloned master, changes merged to master, but not yet released, may cause unexpected results.)

    Parameters

    • starterVersion: string

      the current version of this CLI

    Returns object

    • branch: string
    • repo: string

Const getUserInfo

  • getUserInfo(spawner: object): (Anonymous function)
  • Parameters

    • spawner: object
        • (file: string, arguments?: keyof string[], options?: execa.Options): execa.ExecaChildProcess
        • (file: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • (file: string, options?: execa.Options): execa.ExecaChildProcess
        • (file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a file.

          Think of this as a mix of child_process.execFile and child_process.spawn.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa('echo', ['unicorns']);
          console.log(stdout);
          //=> 'unicorns'
          
          // Cancelling a spawned process
          const subprocess = execa('node');
          setTimeout(() => { spawned.cancel() }, 1000);
          try {
          await subprocess;
          } catch (error) {
          console.log(subprocess.killed); // true
          console.log(error.isCanceled); // true
          }
          })();
          
          // Pipe the child process stdout to the current stdout
          execa('echo', ['unicorns']).stdout.pipe(process.stdout);

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • file: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • command: function
        • command(command: string, options?: execa.Options): execa.ExecaChildProcess
        • command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Same as execa() except both file and arguments are specified in a single command string. For example, execa('echo', ['unicorns']) is the same as execa.command('echo unicorns').

          If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if command is not a constant but a variable, for example with __dirname or process.cwd(). Except for spaces, no escaping/quoting is needed.

          The shell option must be used if the command uses shell-specific features, as opposed to being a simple file followed by its arguments.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa.command('echo unicorns');
          console.log(stdout);
          //=> 'unicorns'
          })();

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • commandSync: function
        • commandSync(command: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • commandSync(command: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Same as execa.command() but synchronous.

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

      • node: function
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.NodeOptions): execa.ExecaChildProcess
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess
        • node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a Node.js script as a child process.

          Same as execa('node', [scriptPath, ...arguments], options) except (like child_process#fork()):

          • the current Node version and options are used. This can be overridden using the nodePath and nodeArguments options.
          • the shell option cannot be used
          • an extra channel ipc is passed to stdio

          Parameters

          • scriptPath: string

            Node.js script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to scriptPath on execution.

          • Optional options: execa.NodeOptions

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • scriptPath: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • sync: function
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • sync(file: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Execute a file synchronously.

          This method throws an Error if the command fails.

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

    Returns (Anonymous function)

hasCLIOptions

Const initialCommit

  • initialCommit(spawner: object): (Anonymous function)
  • Parameters

    • spawner: object
        • (file: string, arguments?: keyof string[], options?: execa.Options): execa.ExecaChildProcess
        • (file: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • (file: string, options?: execa.Options): execa.ExecaChildProcess
        • (file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a file.

          Think of this as a mix of child_process.execFile and child_process.spawn.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa('echo', ['unicorns']);
          console.log(stdout);
          //=> 'unicorns'
          
          // Cancelling a spawned process
          const subprocess = execa('node');
          setTimeout(() => { spawned.cancel() }, 1000);
          try {
          await subprocess;
          } catch (error) {
          console.log(subprocess.killed); // true
          console.log(error.isCanceled); // true
          }
          })();
          
          // Pipe the child process stdout to the current stdout
          execa('echo', ['unicorns']).stdout.pipe(process.stdout);

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • file: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • command: function
        • command(command: string, options?: execa.Options): execa.ExecaChildProcess
        • command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Same as execa() except both file and arguments are specified in a single command string. For example, execa('echo', ['unicorns']) is the same as execa.command('echo unicorns').

          If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if command is not a constant but a variable, for example with __dirname or process.cwd(). Except for spaces, no escaping/quoting is needed.

          The shell option must be used if the command uses shell-specific features, as opposed to being a simple file followed by its arguments.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa.command('echo unicorns');
          console.log(stdout);
          //=> 'unicorns'
          })();

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • commandSync: function
        • commandSync(command: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • commandSync(command: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Same as execa.command() but synchronous.

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

      • node: function
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.NodeOptions): execa.ExecaChildProcess
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess
        • node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a Node.js script as a child process.

          Same as execa('node', [scriptPath, ...arguments], options) except (like child_process#fork()):

          • the current Node version and options are used. This can be overridden using the nodePath and nodeArguments options.
          • the shell option cannot be used
          • an extra channel ipc is passed to stdio

          Parameters

          • scriptPath: string

            Node.js script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to scriptPath on execution.

          • Optional options: execa.NodeOptions

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • scriptPath: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • sync: function
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • sync(file: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Execute a file synchronously.

          This method throws an Error if the command fails.

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

    Returns (Anonymous function)

inquire

Const install

  • install(spawner: object): (Anonymous function)
  • Parameters

    • spawner: object
        • (file: string, arguments?: keyof string[], options?: execa.Options): execa.ExecaChildProcess
        • (file: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • (file: string, options?: execa.Options): execa.ExecaChildProcess
        • (file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a file.

          Think of this as a mix of child_process.execFile and child_process.spawn.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa('echo', ['unicorns']);
          console.log(stdout);
          //=> 'unicorns'
          
          // Cancelling a spawned process
          const subprocess = execa('node');
          setTimeout(() => { spawned.cancel() }, 1000);
          try {
          await subprocess;
          } catch (error) {
          console.log(subprocess.killed); // true
          console.log(error.isCanceled); // true
          }
          })();
          
          // Pipe the child process stdout to the current stdout
          execa('echo', ['unicorns']).stdout.pipe(process.stdout);

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • file: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • command: function
        • command(command: string, options?: execa.Options): execa.ExecaChildProcess
        • command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Same as execa() except both file and arguments are specified in a single command string. For example, execa('echo', ['unicorns']) is the same as execa.command('echo unicorns').

          If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if command is not a constant but a variable, for example with __dirname or process.cwd(). Except for spaces, no escaping/quoting is needed.

          The shell option must be used if the command uses shell-specific features, as opposed to being a simple file followed by its arguments.

          example
          import execa from 'execa';
          
          (async () => {
          const {stdout} = await execa.command('echo unicorns');
          console.log(stdout);
          //=> 'unicorns'
          })();

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • commandSync: function
        • commandSync(command: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • commandSync(command: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Same as execa.command() but synchronous.

          Parameters

          • command: string

            The program/script to execute and its arguments.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • command: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

      • node: function
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.NodeOptions): execa.ExecaChildProcess
        • node(scriptPath: string, arguments?: keyof string[], options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess
        • node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>
        • Execute a Node.js script as a child process.

          Same as execa('node', [scriptPath, ...arguments], options) except (like child_process#fork()):

          • the current Node version and options are used. This can be overridden using the nodePath and nodeArguments options.
          • the shell option cannot be used
          • an extra channel ipc is passed to stdio

          Parameters

          • scriptPath: string

            Node.js script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to scriptPath on execution.

          • Optional options: execa.NodeOptions

          Returns execa.ExecaChildProcess

          A child_process instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.

        • Parameters

          • scriptPath: string
          • Optional arguments: keyof string[]
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options

          Returns execa.ExecaChildProcess

        • Parameters

          • scriptPath: string
          • Optional options: execa.Options<null>

          Returns execa.ExecaChildProcess<Buffer>

      • sync: function
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, arguments?: keyof string[], options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • sync(file: string, options?: execa.SyncOptions): ExecaSyncReturnValue
        • sync(file: string, options?: execa.SyncOptions<null>): ExecaSyncReturnValue<Buffer>
        • Execute a file synchronously.

          This method throws an Error if the command fails.

          Parameters

          • file: string

            The program/script to execute.

          • Optional arguments: keyof string[]

            Arguments to pass to file on execution.

          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

          A result Object with stdout and stderr properties.

        • Parameters

          • file: string
          • Optional arguments: keyof string[]
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions

          Returns ExecaSyncReturnValue

        • Parameters

          • file: string
          • Optional options: execa.SyncOptions<null>

          Returns ExecaSyncReturnValue<Buffer>

    Returns (Anonymous function)

Const normalizePath

  • normalizePath(path: string): string
  • On Windows, normalize returns "\" as the path separator. This method normalizes with POSIX.

    Parameters

    • path: string

    Returns string

power

  • power(base: number, exponent: number): number
  • Raise the value of the first parameter to the power of the second using the es7 ** operator.

    Example (es module)

    import { power } from 'typescript-starter'
    console.log(power(2,3))
    // => 8

    Example (commonjs)

    var power = require('typescript-starter').power;
    console.log(power(2,3))
    // => 8

    Parameters

    • base: number
    • exponent: number

    Returns number

Const readPackageJson

  • readPackageJson(path: string): any

sha256

  • sha256(message: string): string
  • Calculate the sha256 digest of a string.

    Example (es imports)

    import { sha256 } from 'typescript-starter'
    sha256('test')
    // => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'

    Parameters

    • message: string

    Returns string

    sha256 message digest

sha256Native

  • sha256Native(message: string): string
  • A faster implementation of sha256 which requires the native Node.js module. Browser consumers should use sha256, instead.

    Example (es imports)

    import { sha256Native as sha256 } from 'typescript-starter'
    sha256('test')
    // => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'

    Parameters

    • message: string

    Returns string

    sha256 message digest

typescriptStarter

  • typescriptStarter(__namedParameters: object, tasks: Tasks): Promise<void>
  • Parameters

    • __namedParameters: object
      • appveyor: boolean
      • circleci: boolean
      • description: string
      • domDefinitions: boolean
      • editorconfig: boolean
      • email: string
      • fullName: string
      • githubUsername: string
      • immutable: boolean
      • install: boolean
      • nodeDefinitions: boolean
      • projectName: string
      • repoInfo: object
        • branch: string
        • repo: string
      • runner: Runner
      • strict: boolean
      • travis: boolean
      • vscode: boolean
      • workingDirectory: string
    • tasks: Tasks

    Returns Promise<void>

validateName

  • validateName(input: string): true | string
  • Parameters

    • input: string

    Returns true | string

Const writePackageJson

  • writePackageJson(path: string, pkg: any): void

Object literals

Const LiveTasks

LiveTasks: object

cloneRepo

cloneRepo: (Anonymous function) = cloneRepo(execa)

initialCommit

initialCommit: (Anonymous function) = initialCommit(execa)

install

install: (Anonymous function) = install(execa)

Generated using TypeDoc