# exec-sync

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

Latest version **0.1.6** (published 2013-06-12) · 0 weekly downloads

## Install

```sh
npm install exec-sync
pnpm add exec-sync
yarn add exec-sync
bun add exec-sync
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2013-06-12 |
| First published | 2012-02-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Jeremy Faivre |
| Maintainers | jeremyfa |
| Keywords | exec, sync, synchronously, synchronous, shell |

## Links

- npm: https://www.npmjs.com/package/exec-sync
- Repository: https://github.com/jeremyfa/node-exec-sync
- npm.io page: https://npm.io/package/exec-sync

## Dependencies (1)

- [ffi](https://npm.io/package/ffi.md) =1.2.5

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.1.6 (latest) — 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

## 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)
``` bash
$ curl http://npmjs.org/install.sh | sh
```

### Installing exec-sync
``` bash
$ 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.

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

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

By default, an Error is thrown if stderr is not empty. Alternatively, the function can return an object with both `stdout` and `stderr` as properties by passing `true` as a second argument (`returnOutAndErr`).


## License 

(The MIT License)

Copyright (c) 2011-2012 Jérémy Faivre &lt;contact@jeremyfa.com&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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