@aacc/sh
v0.0.1
Published
Execa wrapper exposing a tagged templates API for executing shell commands
Downloads
34
Readme
@aacc/sh
Execa wrapper exposing a tagged templates API for executing shell commands
Installation
npm install @aacc/sh
Usage
Basic
import { sh } from '@aacc/sh'
const { stdout } = await sh`echo 'Hello world'`
console.log(stdout)
With options
import { sh } from '@aacc/sh'
await sh({ stdio: 'inherit' })`echo 'Hello world'`
See the execaCommand documentation for details on the available options
With shell syntax
import { sh } from '@aacc/sh'
await sh({ stdio: 'inherit', shell: true })`echo 'Hello world' | wc -w`
See the execaCommand documentation for details on the available options
Create sh
API with pre-configured options
import { createSh } from '@aacc/sh'
const sh = createSh({ stdio: 'inherit', shell: true })
await sh`echo 'Hello world' | wc -w`
See the execaCommand documentation for details on the available options