0.1.5 • Published 4 years ago
pikaz-shell v0.1.5
Introduction
简单封装的执行命令的node脚本。
Installation
With npm or yarn
yarn add pikaz-shell
npm i -S pikaz-shell
For Typical use
以windows操作系统为例
const shell = require("./index")
shell([{ cmd: ["tree>tree1.txt","tree>tree2.txt"]},{ cmd: ["mkdir pikaz-shell"], path: "D:\\" }])
Demo代码
Methods:
方法名 | 说明 | 参数 |
---|---|---|
shell | 导出函数 | function(attributes) |
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
cmd | 需执行的命令 | String[] | -- | -- |
path | 进程的当前工作目录 | string | -- | null(执行node文件的当前目录) |
timeout | 超时时间 | number | -- | 0 |