这是我如何使其工作的方法:
var cp = require('child_process');var optipng = require('pandoc-bin').path; //This is a path to a commandvar child = cp.spawn(optipng, ['--from=markdown', '--to=html']); //the array is the argumentschild.stdin.write('# HELLO'); //my command takes a markdown string...child.stdout.on('data', function (data) { console.log('stdout: ' + data);});child.stdin.end();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)