Skip to content

Commit

Permalink
Add experimental CLI interface, try npm_cli('node', 'npm', 'help', '-…
Browse files Browse the repository at this point in the history
…-long', 'foo')

Lots of issues with it GH-8
  • Loading branch information
deathcap committed Feb 11, 2015
1 parent 4714278 commit 3176440
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"wzrd": "^1.2.1",
"brfs": "^1.3.0",
"through": "^2.3.6",
"browserify-fs": "^1.0.0"
"browserify-fs": "^1.0.0",
"asarray": "^0.1.0"
},
"license": "MIT"
}
9 changes: 9 additions & 0 deletions webnpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,13 @@ function main() {

console.log('WebNPM loaded. Try browserify() or npm.commands.*()');
});

var asarray = require('asarray');

global.npm_cli = function() {
// Call the NPM command-line interface with the given function arguments
process.argv = asarray(arguments); // for .slice, on Array but not arguments
require('npm/cli.js');
// this only works once :( TODO
};
}

0 comments on commit 3176440

Please sign in to comment.