Options
All
  • Public
  • Public/Protected
  • All
Menu

typescript-starter

Index

Type aliases

TypescriptStarterArgsOptions

TypescriptStarterUserOptions

Variables

Const inherit

inherit: undefined | null | number | "pipe" | "ipc" | "ignore" | "inherit" | Stream = 'inherit' as StdIOOption

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: ExecaStatic, suppressOutput?: boolean): (Anonymous function)
  • Parameters

    • spawner: ExecaStatic
    • 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: ExecaStatic): (Anonymous function)
  • Parameters

    • spawner: ExecaStatic

    Returns (Anonymous function)

hasCLIOptions

Const initialCommit

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

    • spawner: ExecaStatic

    Returns (Anonymous function)

inquire

Const install

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

    • spawner: ExecaStatic

    Returns (Anonymous function)

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
      • 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