@ravindu01manoj/bash-js
v1.0.4
Published
exec shell commands and scripts
Downloads
4
Maintainers
Readme
SHELL SCRIPT AND COMMANDS RUN WITH NODEJS
Installation
npm i @ravindu01manoj/bash-js
## or
yarn add @ravindu01manoj/bash-js
Example
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()