shella
Tagged template to run shell script with execa
.
Install
$ npm i shella
Usage
shella
returns a value that execa
returns.
const shella = ; async { // async by default await shella` echo abcde | sed -e 's/bcd/!!!/' > ./result.txt grep a ./result.txt`; // interporation (shell-escaped) const msg = `Bob's pen`; await shella`echo `;}; // syncshellasync`echo foo`;
Options
You can specify options for execa
.
shella
specify stdio: 'inherit'
by default, but the other options are execa
's default.
// with execa optionsconst stdout stderr = await `echo foo`;console; // sync with execa optionsshella`echo foo`;
Related
- execa: A better
child_process
- @tehshrike/shell-escape-tag: shell-escape-tag, but with a much smaller install size
License
MIT License: Teppei Sato <teppeis@gmail.com>