Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/paulmillr/tag-shell

Use ES6 template tags for your node.js shell commands.
https://github.com/paulmillr/tag-shell

Last synced: 3 months ago
JSON representation

Use ES6 template tags for your node.js shell commands.

Awesome Lists containing this project

README

        

# tag-shell

Use ES6 template tags for your node.js shell commands.

Using *backticks* is important and the package won't work otherwise.

```javascript
const sh = require('tag-shell');
const opts = {app: 'App', icon: 'icon.png'};

// Async.
sh.async`notify-send -a ${opts.app}
-i ${opts.icon}
`;

// Streaming.
sh.spawn`node -v`.stdout.on('data', data => console.log(data.toString()))

// Sync.
const version = sh`node -v`;
```

## License

MIT