Skip to content

Instantly share code, notes, and snippets.

@cjlyth
Created April 8, 2014 19:27
Show Gist options
  • Save cjlyth/10176281 to your computer and use it in GitHub Desktop.
Save cjlyth/10176281 to your computer and use it in GitHub Desktop.
simple example of using npm inside a grunt task
var gulp = require('gulp');
var npm = require("npm");
var pkg = require("./package.json")
gulp.task('default', [], function(cb){
npm.load(pkg, function (er, npm) {
// npm.config.set('global', true);
npm.commands.update([],cb);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment