# x-exec

> convenience wrapper for node child_process.execSync

Latest version **1.2.0** (published 2020-10-14) · MIT license · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2020-10-14 |
| First published | 2020-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jared Henderson |
| Maintainers | jaredh159 |

## Links

- npm: https://www.npmjs.com/package/x-exec
- Repository: https://github.com/jaredh159/x-exec
- Homepage: https://github.com/jaredh159/x-exec#readme
- Issues: https://github.com/jaredh159/x-exec/issues
- npm.io page: https://npm.io/package/x-exec

## Recent versions

- 1.2.0 (latest) — 2020-10-14
- 1.1.0 — 2020-10-02
- 1.0.0 — 2020-10-02

## README

# x-exec

Simple convenience wrapper for doing shell stuff in node. Provides a few helpful functions
wrapping `child_process.exec/execSync`:

## Synchronous API

```ts
import exec from 'x-exec';

// `err` is null | ErrData, `output` is whatever went to stdout
const [err, output] = exec(`which cowsay`);

// returns whatever would have gone to stdout
// but if there was an error, logs it and exits "1"
const output = exec.exit(`which cowsay`);

// swallows stdout, and just returns a boolean for exit code
const success = exec.success(`which cowsay`);

// passes stdout/err thru to parent process stdout/err
// returning boolean for exit code
const success = exec.out(`which cowsay`);
```

## Async (Promise) API

```ts
import exec from 'x-exec';

// `err` is null | ErrData, `output` is whatever went to stdout
const [err, output] = await exec.async(`which cowsay`);

// returns whatever would have gone to stdout
// but if there was an error, logs it and exits "1"
const output = await exec.async.exit(`which cowsay`);

// swallows stdout, and just returns a boolean for exit code
const success = await exec.async.success(`which cowsay`);

// there is no async version of `exec.out`
```

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