Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

meshell

2.0.2 • Public • Published

Meshell Codeship Status for artemave/meshell

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 freaking thing.

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

Usage

npm install meshell
const Shell = require('meshell')
 
const sh = new Shell()
const output = await sh('ls -la')
 
// start in a particular directory (defaults to process.cwd())
const sh = new Shell({cwd: '/some/dir'})
 
// change it later
sh.cd('../test')
 
// background process; returns 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})

Print all commands and their output to console:

DEBUG=meshell node myScript.js

Install

npm i meshell

DownloadsWeekly Downloads

8

Version

2.0.2

License

MIT

Unpacked Size

9.08 kB

Total Files

12

Last publish

Collaborators

  • avatar