2.1.4 • Published 1 year ago

meshell v2.1.4

Weekly downloads
191
License
MIT
Repository
github
Last release
1 year ago

Meshell Codeship Status for artemave/meshell npm version

Sacré bleu! Running shell commands from Node just can't get any simpler.

Why?

I always have to look up child_process whenever I need to run some shell command in Node. While this may be a good thing - I will learn something eventually - sometimes I just want to run the damn thing.

This library offers a really really straitforward way to run shell commands. I dare you to not get it.

Usage

npm install meshell
const Shell = require('meshell')

const sh = new Shell()

// output is both stdout and stderr
const output = await sh('ls -la')

// background process; returns pid instead of output; does not wait for the process to complete
const pid = await sh('sleep 10', {bg: true})

// collect output as it comes
await sh('git push heroku master', {outputStream: process.stdout})

// throws on exit code > 0
await sh('cat /does/not/exist')

// start in a particular directory (defaults to process.cwd())
const sh = new Shell({cwd: '/some/dir'})

// change it later
sh.cd('../test')

// where are we?
sh.cwd // => /some/test

Print all commands and their output to console:

DEBUG=meshell node myScript.js
2.1.4

1 year ago

2.1.2

4 years ago

2.1.3

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago