Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search node_modules for a specific prefix #2

Closed
mattmcmanus opened this issue Jun 19, 2013 · 2 comments
Closed

Search node_modules for a specific prefix #2

mattmcmanus opened this issue Jun 19, 2013 · 2 comments

Comments

@mattmcmanus
Copy link
Owner

Allow for:

var cli = helmsman({ npmPrefix:'nabu-cli-' });

and it will automatically search the libraries npm installed packages and add any exposed 'commands'

@missinglink
Copy link

hey @mattmcmanus this would be really cool, are you still interested in doing something this this?

@missinglink
Copy link

as a hacky work-around, I just ended up doing this:

#!/usr/bin/env node

// load binaries from node_modules
var pkg = require('../package');
pkg.commands.forEach( function( moduleName ){
  process.env.PATH += ':' + process.cwd() + '/node_modules/' + moduleName + '/bin';
});

var helmsman = require('helmsman');
helmsman({ usePath: true }).parse();

... and in my package.json

  "commands": [
    "submodule1",
    "submodule2"
  ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants