Skip to content

Instantly share code, notes, and snippets.

@zavr-1
Created December 5, 2018 05:56
Show Gist options
  • Save zavr-1/3253e4d4e5c0d0148239448d01779762 to your computer and use it in GitHub Desktop.
Save zavr-1/3253e4d4e5c0d0148239448d01779762 to your computer and use it in GitHub Desktop.
// internals: [ 'child_process' ]
const requires = internals.map((key) => {
return `const DEPACK$${key} = require('${key}');`
}).join('\n')
const data = `${requires}\n${stdout}`
/*
const DEPACK$child_process = require('child_process');
'use strict';
const {fork:a} = DEPACK$child_process;
const {stdout:b, stderr:c} = a('.', [], {stdio:'pipe', execArgv:[]}).on('error', (d) => {
console.log(d);
});
b.pipe(process.stdout);
c.pipe(process.stderr);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment