UNPKG

shakediff

Version:

Shake an es6 module for named exports and diff the result

14 lines (11 loc) 340 B
import { spawn } from 'child_process' // Spawn diff. async function spiff(tool, pathA, pathB) { const [ command, ...args ] = tool.split(' ') return new Promise((resolve, reject) => { spawn(command, [ ...args, pathA, pathB ], { stdio: 'inherit' }) .once('error', reject) .once('close', resolve) }) } export { spiff }