saltyshiomix / node-npx

A tiny npx alternative for Node.js, which executes local npm package binaries

Home Page:https://npm.im/node-npx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

anything like this but for regular modules?

airtonix opened this issue · comments

would be great to be able to create a cli, where people can do :

$ a-tool --plugin some-npm-package --plugin another-npm-package

then in my tool i'd do something like :

const someCoreThing = require('some-core-thing')
const npx = require('node-npx')

nconf.argv({ 
  plugin: {
    type: 'array'
  }
})

const options = nconf.get()

options.plugin && options.plugin.forEach((plugin) => {
  npx(plugin)
   .then(someCoreThing.registerPlugin)
  })