GithubHelp home page GithubHelp logo

saltyshiomix / node-npx Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 37 KB

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

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

License: MIT License

TypeScript 100.00%
npx nodejs javascript typescript npm

node-npx's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.