addPackageDependencies

Type:Function
Status:beta
Since:1.0.0
Platform:node
@blackbyte.sugar.node.package

This function allows you to add some dependencies to a package.json file

Params

  1. deps*-Object

    The dependencies to add

  2. settings{}TAddPackageDependenciesSettings

    Some settings to configure your process

Return

  1. -Promise<any>

    A promise with the package.json content as object

Example

import { addPackageDependencies } from '@blackbyte/sugar/package`;
addPackageDependencies('lodash');

Settings

  1. cwdprocess.cwd()String

    The directory in which you want to start the research

  2. devfalseBoolean

    Specify if you want to add the dependencies to the devDependencies

  3. globalfalseBoolean

    Specify if you want to add the dependencies to the global package.json

  4. installfalseBoolean

    Specify if you want to install the dependencies after adding them

  5. overridefalseBoolean

    Specify if you want to override the dependencies if they already exists