node-child-process-async:覆盖Node的child_process模块​​的最佳方法w Promises

时间:2021-05-17 14:43:25
【文件属性】:
文件名称:node-child-process-async:覆盖Node的child_process模块​​的最佳方法w Promises
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-17 14:43:25
JavaScript 子进程异步 覆盖 Node的模块的最佳方法 child-process-async提供了对原始child_process函数的直接替代,而不仅仅是返回Promise的重复方法。 所以,当你调用exec(...)我们还是回到一个ChildProcess的实例,只需用.then()和.catch()添加到它,使其答应友好。 安装 npm install --save child-process-async 用法 // OLD: const { exec , spawn } = require ( 'child_process' ) ; // NEW: const { exec , spawn } = require ( 'child-process-async' ) ; exec() async function ( ) { const { stdout , stderr } = a
【文件预览】:
node-child-process-async-master
----.gitignore(884B)
----.flowconfig(39B)
----package.json(834B)
----package-lock.json(11KB)
----LICENSE(1KB)
----child-process-async.js(2KB)
----README.md(2KB)
----test()
--------child-process-async.js(0B)

网友评论