Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ravindu01manoj/bash-js

Run Shell Commands in nodejs project
https://github.com/ravindu01manoj/bash-js

Last synced: 9 days ago
JSON representation

Run Shell Commands in nodejs project

Awesome Lists containing this project

README

        

# SHELL SCRIPT AND COMMANDS RUN WITH NODEJS

***

- [Ravindu Manoj](https://github.com/ravindu01manoj/)

***

## Installation
```sh
npm i @ravindu01manoj/bash-js
## or
yarn add @ravindu01manoj/bash-js
```

***

## Example
```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()

```

***