node-npx
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

Execute local npm package binaries like a npx for Node.js

Install

$ npm install --save node-npx

Usage

// default import (asynchronously)
import npx from 'node-npx';
 
// named import is also supported
import { npx, npxSync } from 'node-npx';
 
// kill port 8080
const childProcess = npx('fkill', ['-f', ':8080'])
childProcess.on('exit', () => {
  console.log('port 8080 was killed!')
})
 
// remove dist folder and list contents
npxSync('rimraf', ['dist']);
npxSync('glob', ['dist/**/*'], {
  cwd: process.cwd(),
  stdio: 'inherit',
});
 
// both relative and absolute paths are also supported
npxSync('./relative/path/to/my-binary');
npxSync('/absolute/path/to/my-binary');

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.5.09latest

Version History

VersionDownloads (Last 7 Days)Published
1.5.09
1.4.30
1.4.20
1.4.10
1.4.00
1.3.10
1.3.00
1.2.00
1.1.10
1.1.00
1.0.20
1.0.10
1.0.00
0.3.10
0.3.00
0.2.30
0.2.20
0.2.10
0.2.00
0.1.20
0.1.10
0.1.00
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i node-npx

Weekly Downloads

8

Version

1.5.0

License

MIT

Unpacked Size

5.88 kB

Total Files

5

Last publish

Collaborators

  • saltyshiomix