# exec-buffer

> Run a buffer through a child process

Latest version **3.2.0** (published 2017-07-14) · MIT license · 0 weekly downloads

## Install

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

## 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 | 3.2.0 |
| Published | 2017-07-14 |
| First published | 2014-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | buffer, exec |

## Links

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

## Dependencies (5)

- [pify](https://npm.io/package/pify.md) ^3.0.0
- [execa](https://npm.io/package/execa.md) ^0.7.0
- [rimraf](https://npm.io/package/rimraf.md) ^2.5.4
- [tempfile](https://npm.io/package/tempfile.md) ^2.0.0
- [p-finally](https://npm.io/package/p-finally.md) ^1.0.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 3.2.0 (latest) — 2017-07-14
- 3.1.0 — 2016-10-24
- 3.0.0 — 2016-04-28
- 2.0.1 — 2015-02-10
- 2.0.0 — 2015-01-20
- 1.1.2 — 2014-10-20
- 1.1.1 — 2014-10-20
- 1.1.0 — 2014-10-19
- 1.0.1 — 2014-09-06
- 1.0.0 — 2014-08-15
- 0.1.1 — 2014-04-24
- 0.1.0 — 2014-04-24

## README

# exec-buffer [![Build Status](http://img.shields.io/travis/kevva/exec-buffer.svg?style=flat)](https://travis-ci.org/kevva/exec-buffer)

> Run a Buffer through a child process


## Install

```
$ npm install exec-buffer
```


## Usage

```js
const fs = require('fs');
const execBuffer = require('exec-buffer');
const gifsicle = require('gifsicle').path;

execBuffer({
	input: fs.readFileSync('test.gif'),
	bin: gifsicle,
	args: ['-o', execBuffer.output, execBuffer.input]
}).then(data => {
	console.log(data);
	//=> <Buffer 47 49 46 38 37 61 ...>
});
```


## API

### execBuffer(options)

#### options

Type: `Object`

##### input

Type: `Buffer`

The `Buffer` to be ran through the child process.

##### bin

Type: `string`

Path to the binary.

##### args

Type: `Array`

Arguments to run the binary with.

#### inputPath

Type: `string`<br>
Default: `tempfile()`

Where `input` will be written to. In most cases you don't need to set this.

#### outputPath

Type: `string`<br>
Default: `tempfile()`

Where output file will be written to. In most cases you don't need to set this.

### execBuffer.input

Returns a temporary path to where the input file will be written.

### execBuffer.output

Returns a temporary path to where the output file will be written.


## License

MIT © [Kevin Mårtensson](https://github.com/kevva)

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