Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saltyshiomix/node-npx
A tiny npx alternative for Node.js, which executes local npm package binaries
https://github.com/saltyshiomix/node-npx
javascript nodejs npm npx typescript
Last synced: 10 days ago
JSON representation
A tiny npx alternative for Node.js, which executes local npm package binaries
- Host: GitHub
- URL: https://github.com/saltyshiomix/node-npx
- Owner: saltyshiomix
- License: mit
- Created: 2018-07-24T12:22:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T13:47:23.000Z (over 1 year ago)
- Last Synced: 2024-10-12T05:46:49.393Z (26 days ago)
- Topics: javascript, nodejs, npm, npx, typescript
- Language: TypeScript
- Homepage: https://npm.im/node-npx
- Size: 36.1 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Execute local npm package binaries like a
npx
for Node.js## Install
```bash
$ npm install --save node-npx
```## Usage
```js
// 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');
```