Skip to content

utanapishtim/shellraiser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

😈 Shellraiser

Raise shell in node, inspired by shellblazer but gives you access to the process itself.

Install

npm i --save shellraiser

Usage

Node

const sh = require('shellraiser')
await sh('ls')
await sh('npm', ['i -S shhh'])
await sh('curl', ['https://github.com'], { stdio: 'inherit' })

CLI

shhh ls
shhh npm i -S shhh

API

const sh = require('shellraiser')

The sh function spawns a process, it is essentially a thin wrapper around const { spawn } = require('child_process')

const shell = sh(cmd, [args], [opts])

Spawn a process that executes cmd with args given opts.

The arguments to sh are the same as spawn.

Optionally, you can await completion of the process with await sh(cmd, args, opts).

shell.then([fn])

Just like Promise's .then().

shell.catch([fn])

Just like Promise's .catch().

shell.resolve([any])

Forcibly resolve the underlying promise with an arbitrary value, automatically cleans up the underlying process.

shell.reject([any])

Forcibly reject the underlying promise with an arbitrary value, automatically cleans up the underlying process.

const { process } = sh(cmd, [args], [opts])

The underlying process object.

const { promise } = sh(cmd, [args], [opts])

The underlying promise.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published