# node-npx

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

Latest version **1.5.0** (published 2019-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-npx
pnpm add node-npx
yarn add node-npx
bun add node-npx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2019-07-16 |
| First published | 2018-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Yoshihide Shiono |
| Maintainers | saltyshiomix |
| Keywords | npx, node, spawn, npm, node-npx, resolve-as-bin |

## Links

- npm: https://www.npmjs.com/package/node-npx
- Repository: https://github.com/saltyshiomix/node-npx
- Issues: https://github.com/saltyshiomix/node-npx/issues
- npm.io page: https://npm.io/package/node-npx

## Dependencies (3)

- [delay](https://npm.io/package/delay.md) ^4.3.0
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^6.0.5
- [resolve-as-bin](https://npm.io/package/resolve-as-bin.md) ^2.1.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.5.0 (latest) — 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
- … 13 more at https://npm.io/package/node-npx/versions

## README

<p align="center">
  <a href="https://www.npmjs.com/package/node-npx"><img src="https://img.shields.io/npm/v/node-npx.svg"></a>
  <a href="https://www.npmjs.com/package/node-npx"><img src="https://img.shields.io/npm/dt/node-npx.svg"></a>
</p>
<p align="center">Execute <b>local</b> npm package binaries like a <code>npx</code> for Node.js</p>

## 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');
```

---
_Source: https://npm.io/package/node-npx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
