Options
All
  • Public
  • Public/Protected
  • All
Menu

External module pkg-install

Index

Type aliases

InstallResult

InstallResult: ExecaReturns & object

Variables

Const access

access: __promisify__ = promisify(fsAccess)

Functions

getCurrentPackageManager

  • Returns the package manager currently active if the program is executed through an npm or yarn script like:

    yarn run example
    npm run example
    export

    Returns SupportedPackageManagers | null

getPackageManager

  • Determine what package manager to use based on what preference is set, and whether it's currently running in a yarn/npm script

    export

    Parameters

    Returns Promise<SupportedPackageManagers>

getPackageManagerFromLockfile

  • Checks for the presence of package-lock.json or yarn.lock to determine which package manager is being used

    export

    Parameters

    • config: InstallConfig

      Config specifying current working directory

    Returns Promise<SupportedPackageManagers | null>

getPackageManagerFromLockfileSync

  • SYNC: Checks for the presence of package-lock.json or yarn.lock to determine which package manager is being used

    export

    Parameters

    • config: InstallConfig

      Config specifying current working directory

    Returns SupportedPackageManagers | null

getPackageManagerSync

  • SYNC: Determine what package manager to use based on what preference is set, and whether it's currently running in a yarn/npm script

    export

    Parameters

    Returns SupportedPackageManagers

install

  • Installs a passed set of packages using either npm or yarn. Depending on: 1) If you specify a preferred package manager 2) If the program is currently running in an npm or yarn script (using npm run or yarn run) 3) What package manager is available

    export

    Parameters

    • packages: Packages

      List or object of packages to be installed

    • Default value options: Partial<InstallConfig> = defaultInstallConfig

    Returns Promise<InstallResult>

installSync

  • SYNC VERSION. Installs a passed set of packages using either npm or yarn. Depending on:

    1) If you specify a preferred package manager 2) If the program is currently running in an npm or yarn script (using npm run or yarn run) 3) If there is a yarn.lock or package-lock.json available 4) What package manager is available

    export

    Parameters

    • packages: PackageList

      List or object of packages to be installed

    • Default value options: Partial<InstallConfig> = defaultInstallConfig

    Returns InstallResult

isManagerInstalled

  • Checks if a given package manager is currently installed by checking its version

    export

    Parameters

    Returns Promise<boolean>

isManagerInstalledSync

  • SYNC: Checks if a given package manager is currently installed by checking its version

    export

    Parameters

    Returns boolean

projectInstall

  • projectInstall(options?: Partial<InstallConfig>): Promise<ExecaReturns>
  • Runs npm install or yarn install for the project. Depending on:

    1) If you specify a preferred package manager 2) If the program is currently running in an npm or yarn script (using npm run or yarn run) 3) If there is a yarn.lock or package-lock.json available 4) What package manager is available

    export

    Parameters

    • Default value options: Partial<InstallConfig> = defaultInstallConfig

    Returns Promise<ExecaReturns>

projectInstallSync

  • projectInstallSync(options?: Partial<InstallConfig>): ExecaReturns
  • SYNC VERSION. Runs npm install or yarn install for the project. Depending on:

    1) If you specify a preferred package manager 2) If the program is currently running in an npm or yarn script (using npm run or yarn run) 3) If there is a yarn.lock or package-lock.json available 4) What package manager is available

    export

    Parameters

    • Default value options: Partial<InstallConfig> = defaultInstallConfig

    Returns ExecaReturns

Generated using TypeDoc