Node exec for next.
npm install -S @jswork/next-node-exec
import '@jswork/next-node-exec';
// single cmd;
nx.nodeExec('npm run build');
// multiple cmds:
nx.nodeExec([
'ls -alh',
'pwd'
]);
// or with pip cmds
nx.nodeExec([
'tail access.log -n 1000',
`awk '{print $1}'`
], { joined: '|'});
//cmds: tail access.log -n 1000 | awk '{print $1}'
name | type | default | description |
---|---|---|---|
responseType | string | string/buffer/null | Return string with trim. |
joined | string | && /& /| |
Joined with char. |
debug | boolean | true/false | If show the executed commands. |
Code released under the MIT license.