@jadesrochers/subprocess

0.1.3 • Public • Published

Subprocess

Runs a shell process using exec from child process module.

Whats the Use?

Just a quick way to run a shell command from a node program by passing
the text of what you want to run.

installation

npm install @jadesrochers/subprocess

const subp = require('@jadesrochers/subprocess')

Usage

Set up some commands.

let comm1 = "head -n 1 /path/to/original.txt"
let comm2 = "cd /path/to/dir && rm -r dirname/*"
let comm3 = "docker build -f Dockerfile-test -t repo/name:tag . && docker push repo/name:tag"

Run the commands. Save the output if you need it.

let rslt = subp.shellCommand(comm1)
subp.shellCommand(comm2)
subp.shellCommand(comm3)

Passing the output to this function will return the stdout or
throw an error if there was one.

subp.commandOutput( rslt )

/@jadesrochers/subprocess/

    Package Sidebar

    Install

    npm i @jadesrochers/subprocess

    Weekly Downloads

    3

    Version

    0.1.3

    License

    Apache-2.0

    Unpacked Size

    4.48 kB

    Total Files

    7

    Last publish

    Collaborators

    • jadesrochers