exec-sync

Execute shell command synchronously. Use this for migration scripts, cli programs, but not for regular server code.

7 个版本
安装
npm install exec-sync
yarn add exec-sync
pnpm add exec-sync
bun add exec-sync
README

exec-sync

Execute shell command synchronously. Use this for migration scripts, cli programs, but not for regular server code.

Installation

Installing npm (node package manager)

$ curl http://npmjs.org/install.sh | sh

Installing exec-sync

$ cd /path/to/your/project
$ [sudo] npm install exec-sync

Using exec-sync from node.js

Warning: use only for special operation or command line scripts written with node. Don't use this for regular server code or it will ruin the responsiveness of your server.

var execSync = require('exec-sync');

var user = execSync('echo $USER');
console.log(user);

TODO

Throw error when something went wrong.

版本列表
0.1.6 2013-06-12
0.1.5 2012-10-02
0.1.4 2012-08-07
0.1.3 2012-07-23
0.1.2 2012-04-13
0.1.1 2012-03-01
0.1.0 2012-02-26