@ravindu01manoj/bash-js
Version:
exec shell commands and scripts
44 lines (32 loc) • 527 B
Markdown
***
- [Ravindu Manoj](https://github.com/ravindu01manoj/)
***
```sh
npm i @ravindu01manoj/bash-js
yarn add @ravindu01manoj/bash-js
```
***
```ts
const bash = require("@ravindu01manoj/bash-js")
async function run() {
//for single command
const out = await bash.command("ls")
console.log(out)
//for script
const script = `
mkdir a
cd a
touch hello.txt
ls
cd ..
`
const output = await bash.script(script)
console.log(output)
}
run()
```
***