Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
add more comments to installPackages function
Browse files Browse the repository at this point in the history
  • Loading branch information
nurra01 committed Oct 24, 2018
1 parent f582a80 commit 6715545
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/imperative/src/plugins/utilities/NpmApiFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ const npm = require("npm");
const iConsole = Logger.getImperativeLogger();

/**
* Common function that installs a npm package.
*
* Common function that installs a npm package using npm APIs.
* npm.load doesn't install with passed configuration values such as global and prefix
* that's why need to use npm.config functions to install packages globally and to a specific prefix
* The link for all configuration values and descriptions:
* https://docs.npmjs.com/misc/config
* The link for use case:
* https://stackoverflow.com/questions/15957529/can-i-install-a-npm-package-from-javascript-running-in-node-js/15957574#15957574
* The link how to use NPM programmatically from npm-cli.js documentation:
* https://github.com/npm/cli/blob/latest/bin/npm-cli.js#L75
* @param {string} prefix Path where to install npm the npm package.
*
* @param {string} global Option to install a package globally or not.
Expand Down

0 comments on commit 6715545

Please sign in to comment.