exec-buffer
Advanced tools
Comparing version
11
index.js
'use strict'; | ||
const fs = require('fs'); | ||
const execa = require('execa'); | ||
const pFinally = require('p-finally'); | ||
const pify = require('pify'); | ||
const rimraf = require('rimraf'); | ||
const tempfile = require('tempfile'); | ||
const fsP = pify(fs); | ||
const rmP = pify(rimraf); | ||
const input = Symbol('inputPath'); | ||
@@ -30,5 +34,10 @@ const output = Symbol('outputPath'); | ||
return fsP.writeFile(inputPath, opts.input) | ||
const promise = fsP.writeFile(inputPath, opts.input) | ||
.then(() => execa(opts.bin, opts.args)) | ||
.then(() => fsP.readFile(outputPath)); | ||
return pFinally(promise, () => Promise.all([ | ||
rmP(inputPath), | ||
rmP(outputPath) | ||
])); | ||
}; | ||
@@ -35,0 +44,0 @@ |
{ | ||
"name": "exec-buffer", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Run a buffer through a child process", | ||
@@ -26,4 +26,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"execa": "^0.3.0", | ||
"execa": "^0.5.0", | ||
"p-finally": "^1.0.0", | ||
"pify": "^2.3.0", | ||
"rimraf": "^2.5.4", | ||
"tempfile": "^1.0.0" | ||
@@ -35,2 +37,3 @@ }, | ||
"is-gif": "^1.0.0", | ||
"path-exists": "^3.0.0", | ||
"xo": "*" | ||
@@ -37,0 +40,0 @@ }, |
4068
7.34%35
25%5
66.67%5
25%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated