Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

sh-exec

2.1.0 • Public • Published

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
  `
})()

install

npm i sh-exec

Downloadsweekly downloads

609

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability