UNPKG

469 BJavaScriptView Raw
1const { printLog } = require('./log');
2const { spawnSync } = require('child_process');
3const chalk = require('chalk');
4
5/**
6 * npm install
7 * @param path {String} Absolute path to a text file.
8 */
9const invokeNpmInstall = function(path) {
10 printLog(chalk.green('Execute'), 'npm install --production');
11 return spawnSync('npm', ['install', '--production'], {
12 cwd: path,
13 env: process.env,
14 stdio: 'inherit'
15 });
16};
17
18module.exports = {
19 invokeNpmInstall
20};