https://github.com/jupegarnica/garn-exec
A deno utility to run subprocess easily.
https://github.com/jupegarnica/garn-exec
deno
Last synced: about 2 months ago
JSON representation
A deno utility to run subprocess easily.
- Host: GitHub
- URL: https://github.com/jupegarnica/garn-exec
- Owner: jupegarnica
- Created: 2021-06-09T10:37:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-20T18:01:42.000Z (over 4 years ago)
- Last Synced: 2025-10-14T14:05:39.800Z (8 months ago)
- Topics: deno
- Language: JavaScript
- Homepage: https://deno.land/x/garn_exec
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Garn Exec
A deno utility to run subprocess easily.
## $ usage
Must be run --allow-run permission.
```js
import { $ } from "https://deno.land/x/garn_exec/exec.js";
await $`cp *.js ..`;
```
```js
import { $ } from "https://deno.land/x/garn_exec/exec.js";
const { stdout, code } = await $`echo hola mundo`;
console.log(stdout); // hola mundo\n
console.log(code); // 0
```
```js
import { $ } from "https://deno.land/x/garn_exec/exec.js";
try {
await $`sh test/fail.sh`;
} catch (error) {
console.log(error.code); // 4
}
```
## cd usage
```js
import { $, cd } from "https://deno.land/x/garn_exec/exec.js";
cd("test");
await $`ls`;
```
## sh usage
```js
import { sh } from "https://deno.land/x/garn_exec/exec.js";
await sh`cd test && ls | grep fail`;
```