Socket
Book a DemoInstallSign in
Socket

shellblazer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shellblazer

Simple module for executing shell commands with less boilerplate.

1.0.6
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

shellblazer

A Node.js module for executing shell commands with less boilerplate.

Installation

To install the module, run the following command in your terminal:

npm i shellblazer

Usage

The module will provide you with a function. Just pass the commands as arrays of strings.

let sh = require('shellblazer')

sh(['mkdir', 'foo'])

The commands are executed with spawn() with {shell: false}, so you cannot pipe output from one command to another.

You can change directory by passing a cwd option to the .configure() method. The method will return a new shellblazer function, that will have the required working directory set:

sh = sh.configure({ cwd: './foo' })
sh(['touch', 'a.txt'])
//this will create the file a.txt inside the foo directory

Shellblazer can execute commands in sequence with a single function call, by taking any number of arrays as arguments

let sh = require ('./index')

sh(['mkdir', 'alpha'], ['mkdir', 'beta'])

FAQs

Package last updated on 15 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.