actions/package-json

Methods

async addDependencies (dependencies) → {Promise}

Add dependencies to the destination the package.json.

Environment watches for package.json changes at this.env.cwd , and triggers an package manager install if it has been committed to disk. If package.json is at a different folder, like a changed generator root, propagate it to the Environment like this.env.cwd = this.destinationPath() .

Parameters:
Name Type Description
dependencies Object | string | Array.<string>
Returns:
Promise -

a 'packageName: packageVersion' object

async addDevDependencies (dependencies) → {Promise}

Add dependencies to the destination the package.json.

Environment watches for package.json changes at this.env.cwd , and triggers an package manager install if it has been committed to disk. If package.json is at a different folder, like a changed generator root, propagate it to the Environment like this.env.cwd = this.destinationPath() .

Parameters:
Name Type Description
dependencies Object | string | Array.<string>
Returns:
Promise -

a 'packageName: packageVersion' object