# execSync

> Node's missing execSync.

Latest version **1.0.2** (published 2014-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install execSync
pnpm add execSync
yarn add execSync
bun add execSync
```

## 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.0.2 |
| Published | 2014-08-24 |
| First published | 2012-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 151 |
| Author | Mario Gutierrez |
| Maintainers | mgutz |

## Links

- npm: https://www.npmjs.com/package/execSync
- Repository: https://github.com/mgutz/execSync
- Issues: https://github.com/mgutz/execSync/issues
- npm.io page: https://npm.io/package/execSync

## Dependencies (1)

- [temp](https://npm.io/package/temp.md) ~0.5.1

## Recent versions

- 1.0.2 (latest) — 2014-08-24
- 1.0.1-pre — 2013-07-14
- 1.0.0-pre — 2013-07-12
- 0.0.4 — 2013-04-15
- 0.0.3 — 2013-02-20
- 0.0.2 — 2013-02-04
- 0.0.1 — 2012-06-09

## README

# execSync

Executes shell commands synchronously.

__WARNING__ For dev machine shell scripting only. **DO NOT USE** for
production servers.

## Install

__Windows__ requires Python and Visual Studio 2012 (Express) installed for
node to build. See [node-gyp installation](https://github.com/TooTallNate/node-gyp#installation).
Pre-built binaries for node v0.8 and node v0.10 are packaged. They should work and if not try manually
building.

    npm install execSync

Sometimes a manual build is necessary on Windows even with all the tools in place, replace Visual Studio version
with '2010' or '2012' based on the version installed.

    npm install node-gyp -g
    node-gyp rebuild --msvs_version=2012

## Usage

Require it

    var sh = require('execSync');

`Run` does not capture output.

    var code = sh.run('echo $USER; echo some_err 1>&2; exit 1');
    console.log('return code ' + code);

Use the less efficient `exec` if you need output. `exec` is just redirection
trickery around `run`.

    var result = sh.exec('echo $USER; echo some_err 1>&2; exit 1');
    console.log('return code ' + result.code);
    console.log('stdout + stderr ' + result.stdout);

## Notes

In *nix and OSX version commands are run via `sh -c YOUR_COMMAND`

In __Windows__ commands are run via `cmd /C YOUR_COMMAND`

## License

Copyright (c) 2012, 2013 Mario Gutierrez mario@mgutz.com

See the file LICENSE for copying permission.

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