runscript
Run script easy!
Last updated 2 years ago by fengmk2 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install runscript 
SYNC missed versions from official npm registry.

runscript

📢📢📢📢📢 You should use execa instead. 📢📢📢📢


NPM version Node.js CI Test coverage npm download

Run script easy!

Installation

npm install runscript

Quick start

Commonjs

const { runScript } = require('runscript');

runScript('node -v', { stdio: 'pipe' })
  .then(stdio => {
    console.log(stdio);
  })
  .catch(err => {
    console.error(err);
  });

ESM & TypeScript

import { runScript } from 'runscript';

runScript('node -v', { stdio: 'pipe' })
  .then(stdio => {
    console.log(stdio);
  })
  .catch(err => {
    console.error(err);
  });

run with timeout

Run user script for a maximum of 10 seconds.

const { runScript } = require('runscript');

runScript('node user-script.js', { stdio: 'pipe' }, { timeout: 10000 })
  .then(stdio => {
    console.log(stdio);
  })
  .catch(err => {
    console.error(err);
  });

Upgrade from 1.x to 2.x

// 1.x
// const runscript = require('runscript');

// 2.x
const { runscript } = require('runscript');

License

MIT

Contributors

Contributors

Made with contributors-img.

Current Tags

  • 2.0.1                                ...           latest (2 years ago)

16 Versions

  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.6.0                                ...           3 years ago
  • 1.5.4                                ...           3 years ago
  • 1.5.3                                ...           5 years ago
  • 1.5.2                                ...           5 years ago
  • 1.5.1                                ...           6 years ago
  • 1.5.0                                ...           7 years ago
  • 1.4.0                                ...           7 years ago
  • 1.3.1                                ...           7 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Downloads
Total 67
Today 0
This Week 5
This Month 32
Last Day 0
Last Week 2
Last Month 19
Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE