app-lib-exec
v1.0.40
Published
命令脚本执行-【app-lib-exec】
Maintainers
Readme
二、功能描述
- 支持能在终端执行的所有命令
- 支持bat、shell等文件的直接执行
三、注意事项
- 打印乱码的时候 需要设置调用参数添加options.stdio即可
[{stdio: 'pipe'}]- option 支持的参数
* stidio 支持的 [pipe,overlapped,ignore,inherit]
分别对应 subprocess.stdin, subprocess.stdout, and subprocess.stderr的输出
'pipe': equivalent to ['pipe', 'pipe', 'pipe'] (the default)
'overlapped': equivalent to ['overlapped', 'overlapped', 'overlapped']
'ignore': equivalent to ['ignore', 'ignore', 'ignore']
'inherit': equivalent to ['inherit', 'inherit', 'inherit'] or [0, 1, 2] // Child will use parent's stdios.
自定义
stdio: ['pipe', 'pipe', process.stderr] // Spawn child sharing only stderr.
* cwd 指定路径
六、API
exec(commondOrFile, args, options, [isAsync]) ⇒ null
数据类型判断
Kind: global function
Returns: null - 无返回
Examples
option下支持的参数
- stidio 支持的 [pipe,overlapped,ignore,inherit]
inherit // Child will use parent's stdios.
stdio: ['pipe', 'pipe', process.stderr] // Spawn child sharing only stderr.| Param | Type | Default | Description | | --- | --- | --- | --- | | commondOrFile | string | | 可执行的文件路径或者文件 | | args | array | | 所有命令行参数 | | options | object | | 执行参数配置 | | [isAsync] | boolean | true | 是否同步 |
