Skip to content
💻 Use `Template literals` write shell script made happy ❤️.
Branch: master
Clone or download
Latest commit f8796b0 Oct 22, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
.gitignore
LICENSE Initial commit Jan 4, 2018
README.md
jest.config.js 2.0 Oct 22, 2018
logo.png
package.json 2.1.0 Oct 22, 2018
prettier.config.js fix ts Oct 12, 2018
tsconfig.json fix ts Oct 12, 2018
tslint.json
yarn.lock

README.md

## Why sh-exec?

Use Template literals write shell script made happy ❤️.

Installation

$ yarn add sh-exec

Examples

import sh from 'sh-exec'
import { version } from '../package.json'

sh`
echo "sh-exec is awesome."
`

sh`
git init
git add .
git commit -m '${version}'
`

Quiet

If you don't like to see the command output or because some security issue.

It's helpful in CI.

import sh from 'sh-exec'

sh.quiet`echo "You can't see"`

Promise Based

sh`
  curl https://a-url.com
`
  .then(stdout => {
    console.log('done')
  })
  .catch(err => {
    console.error(err)
  })

// or
;(async () => {
  const stdout = await sh`
    curl https://a-url.com
  `
})()
You can’t perform that action at this time.