I\'m using a library that wraps pandoc
for node. But I can\'t figure out how to pass STDIN to the child process `execFile...
var execFile = requ
Here's how I got it to work:
var cp = require('child_process');
var optipng = require('pandoc-bin').path; //This is a path to a command
var child = cp.spawn(optipng, ['--from=markdown', '--to=html']); //the array is the arguments
child.stdin.write('# HELLO'); //my command takes a markdown string...
child.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
child.stdin.end();