Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwu823/sh-exec
💻 Use `Template literals` write shell script made happy ❤️.
https://github.com/rwu823/sh-exec
exec nodejs process script sh shell
Last synced: 14 days ago
JSON representation
💻 Use `Template literals` write shell script made happy ❤️.
- Host: GitHub
- URL: https://github.com/rwu823/sh-exec
- Owner: rwu823
- License: mit
- Created: 2018-01-04T13:40:35.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T14:47:29.000Z (11 months ago)
- Last Synced: 2024-10-22T15:40:17.632Z (24 days ago)
- Topics: exec, nodejs, process, script, sh, shell
- Language: TypeScript
- Size: 127 KB
- Stars: 94
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Why sh-exec?Use `Template literals` write shell script made happy ❤️.
## Installation
```sh
$ yarn add sh-exec
```## Examples
```js
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.
```js
import sh from 'sh-exec'sh.quiet`echo "You can't see"`
```## Promise Based
```js
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
`
})()
```