shella

1.0.1 • Public • Published

shella

Tagged template to run shell script with execa.

npm version Node.js Version Support build status dependency status License

Install

$ npm i shella

Usage

shella returns a value that execa returns.

const shella = require('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 ${msg}`;
})();
 
// sync
shella.sync`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 options
const {stdout, stderr} = await shella({stdio: 'pipe'})`echo foo`;
console.log(stdout);
 
// sync with execa options
shella.sync({stdio: 'pipe'})`echo foo`;

Related

License

MIT License: Teppei Sato <teppeis@gmail.com>

Readme

Keywords

none

Package Sidebar

Install

npm i shella

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

4.85 kB

Total Files

4

Last publish

Collaborators

  • teppeis