npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

fallback-exec-sync

0.0.1 • Public • Published

fallback-exec-sync

Fall back to shelljs if execSync cannot be installed. On Windows, execSync hards to be installed sometimes because of requirement for installation of node-gyp. Shelljs also has synchronous exec but a little slower than execSync. So one of solutions is that try to install execSync first and if failed, install shelljs.

Install

npm install fallback-exec-sync

Usage

var sh = require('fallback-exec-sync');
 
code = sh.run('echo 1');
console.log(code); //=> 0
 
// Note that a little difference from execSync.
// "stdout" is replaced to "output".
res = sh.exec('echo 1');
console.log(res.code); //=> 0
console.log(res.output); //=> 1\n

Test

npm test

License

Licensed under the MIT license.

Special thanks to

install

npm i fallback-exec-sync

Downloadsweekly downloads

2

version

0.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability