node-npx

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

MIT 28 个版本
安装
npm install node-npx
yarn add node-npx
pnpm add node-npx
bun add node-npx
README

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');
版本列表
1.5.0 2019-07-16
1.4.3 2019-07-16
1.4.2 2019-07-16
1.4.1 2019-07-16
1.4.0 2019-07-16
1.3.1 2018-10-06
1.3.0 2018-10-06
1.2.0 2018-08-07
1.1.1 2018-08-07
1.1.0 2018-08-07
1.0.2 2018-07-30
1.0.1 2018-07-30
1.0.0 2018-07-30
0.3.1 2018-07-27
0.3.0 2018-07-27
0.2.3 2018-07-26
0.2.2 2018-07-26
0.2.1 2018-07-26
0.2.0 2018-07-26
0.1.2 2018-07-26
0.1.1 2018-07-26
0.1.0 2018-07-26
0.0.6 2018-07-24
0.0.5 2018-07-24
0.0.4 2018-07-24
0.0.3 2018-07-24
0.0.2 2018-07-24
0.0.1 2018-07-24