How to use the npm.on function in npm

To help you get started, we’ve selected a few npm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PRINTR3D / formide-client / src / implementations / macos / lib / update.js View on Github external
}, function (err) {
                        if (err) return FormideClient.log.error(err);

                        npm.commands.install(deps, function (err, data) {
                            if (err) return FormideClient.log.error(err);

                            // restart app

                        });

                        npm.on("log", function (message) {
                            console.log(message);
                        });
                    });
            });
github aurelia / cli / src / lib / installer / index.js View on Github external
npm.load(function(err) {
    npm.commands.install(['.'], function(er, data) {
      if(er !== undefined && er !== null) {
        console.log(er);
        throw 'Error running NPM install';
      } else {
        cb();
      }
    });

    npm.on("log", function (message) {
      // log the progress of the installation
      console.log(message);
    });
  });
}
github CityWebConsultants / Iris / iris_core / install.js View on Github external
if (err) {

        console.log(err);

      } else {

        console.log(data);

      }

    });

  });

  npm.on("log", function (message) {
    // log the progress of the installation
    console.log(message);
  });
});
github IonicaBizau / learning-nodejs / index.js View on Github external
}, function (err) {
  // catch errors
  npm.commands.install(createNpmDependenciesArray('./tests/package'), function (er, data) {
    // log the error or data
  });
  npm.on("log", function (message) {
    // log the progress of the installation
    console.log(message);
  });
});
github pencilblue / pencilblue / pencilblue.js View on Github external
this.initModules = function(cb) {
        npm.on('log', function(message) {
            pb.log.info(message);
        });

        HtmlEncoder.EncodeType = 'numerical';

        pb.Localization.init(cb);
    };
github FormidableLabs / converter-react / heroku / scripts / install.js View on Github external
npm.load(function (loadErr) {
  if (loadErr) { throw loadErr; }
  npm.commands.install(herokuDeps, function (installErr) {
    if (installErr) { throw installErr; }
  });
  npm.on("log", function (msg) {
    console.log(msg);
  });
});
github rendrjs / rendr / scripts / postinstall.js View on Github external
}, function(err) {
  if (err) return handleError(err);
  npm.commands.install(packages, function(err, message) {
    if (err) return handleError(err);
    console.log("NPM POSTINALL: %s", message);
  });
  npm.on("log", function(message) {
    console.log("NPM POSTINALL: %s", message);
  });
});
github tikalk / commandcar / main.js View on Github external
npm.load(function (err) {
			if(err){
				console.log('error installing from npm: ' + err);
			}else{
				npm.commands.install(__dirname,[SCOPE + "/" + options.api], function (er, data) {
					if(er){
						console.log('npm error: ' + er);
					}
					database = buildDatabaseFromFileSystem();
				});
				npm.on("log", function (message) {
					console.log(message);
				});
				
			}
		});
github 3rd-Eden / canihaz / lib / canihaz.js View on Github external
npm.load(configuration, function npmloaded(err) {
      if (err) return fn(err);

      npm.commands.install(
          installation
        , [packages + '@' + version]
        , function installed(err) {
            if (err) return fn(err);
            return fn(undefined, require(location));
          }
      );

      npm.on('log', function log() {

      });
    });
  }
github apogeu / apogeu / src / installDependencies.js View on Github external
npm.load({ prefix: projectFolder }, (err) => {
    if (err) return reject(err);

    npm.commands.install([projectFolder], (error) => {
      if (err) return reject(error);
      debug('dependencies installed');
      resolve();
    });

    npm.on('log', message => debug(message));
  });
});