Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@bconnorwhite/exec

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bconnorwhite/exec

Execute commands while keeping flags easily configurable as an object.

Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
124
202.44%
Maintainers
1
Weekly downloads
 
Created
Source

@bconnorwhite/exec

dependencies minzipped size typescript npm

Execute commands while keeping flags easily configurable as an object.

yarn add @bconnorwhite/exec
  • Run one or multiple commands
  • Run commands in parallel or series
  • Automatically pass through output by setting stdio: "inherit"

API

exec

Types
exec(command: string, flags?: Flags) => void

type Flags = {
  [flag: string]: string | boolean;
}
Usage
import exec from "@bconnorwhite/exec";

exec("babel ./src", {
  "out-dir": "./build",
  "config-file": "./babel.config.json",
  "watch": true
});
// babel ./src --out-dir ./build --config-file ./babel.config.json --watch

execAll

Types
execAll(commands: Command[], options: Options) => void

type Command = {
  command: string;
  flags?: Flags;
}

type Options = {
  parallel?: boolean; // true will separate commands by &, false or undefined by &&.
}
Usage
import { execAll } from "@bconnorwhite/exec";

execAll([{
  command: "babel ./src",
  flags: {
    "out-dir": "./build",
    "config-file": "./babel.config.json",
    "watch": true
  }
}, {
  command: "tsc --emitDeclarationOnly"
}], {
  parallel: false
});
// babel ./src --out-dir ./build --config-file ./babel.config.json --watch && tsc --emitDeclarationOnly

flag

Types
flag(command: string, options: Options) => string

type Options = {
  parallel?: boolean; // true will separate commands by &, false or undefined by &&.
}
Usage
import { flag } from "@bconnorwhite/exec";

flag("babel ./src", {
  "out-dir": "./build",
  "config-file": "./babel.config.json",
  "watch": true
});
// babel ./src --out-dir ./build --config-file ./babel.config.json --watch

Keywords

exec

FAQs

Package last updated on 22 Jul 2020

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