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.0
Version published
Weekly downloads
129
316.13%
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
  • Automatically sets stdio: "inherit" so output is passed through.
  • Run one or multiple commands
  • Run commands in parallel or series

API

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

type Flags = {
  [flag: string]: string | boolean;
}
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
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 &&.
}
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
flag(command: string, options: Options) => string

type Options = {
  parallel?: boolean; // true will separate commands by &, false or undefined by &&.
}
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 29 Mar 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