Initial commit
[yaffs-website] / node_modules / exec-buffer / readme.md
1 # exec-buffer [![Build Status](http://img.shields.io/travis/kevva/exec-buffer.svg?style=flat)](https://travis-ci.org/kevva/exec-buffer)
2
3 > Run a buffer through a child process
4
5
6 ## Install
7
8 ```
9 $ npm install --save exec-buffer
10 ```
11
12
13 ## Usage
14
15 ```js
16 const fs = require('fs');
17 const execBuffer = require('exec-buffer');
18 const gifsicle = require('gifsicle').path;
19
20 execBuffer({
21         input: fs.readFileSync('test.gif'),
22         bin: gifsicle,
23         args: ['-o', execBuffer.output, execBuffer.input]
24 }).then(data => {
25         console.log(data);
26         //=> <Buffer 47 49 46 38 37 61 ...>
27 });
28 ```
29
30
31 ## API
32
33 ### execBuffer(options)
34
35 #### options
36
37 ##### input
38
39 Type: `buffer`
40
41 The `buffer` to be ran through the child process.
42
43 ##### bin
44
45 Type: `string`
46
47 Path to the binary.
48
49 ##### args
50
51 Type: `array`
52
53 Arguments to run the binary with.
54
55 ### execBuffer.input
56
57 Returns a temporary path to where the input file will be written.
58
59 ### execBuffer.output
60
61 Returns a temporary path to where the output file will be written.
62
63
64 ## License
65
66 MIT © [Kevin Mårtensson](https://github.com/kevva)