New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sb-exec

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sb-exec

Process spawning APIs beautified

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
363
increased by140.4%
Maintainers
2
Weekly downloads
 
Created
Source

Exec

Greenkeeper badge

Node's Process spawning APIs beautified

Installation

npm install --save sb-exec

API

type $OptionsAccepted = {
  timeout?: number | Infinity, // In milliseconds
  stream?: 'stdout' | 'stderr'  | 'both',
  env: Object,
  stdin?: string | Buffer,
  local?: {
    directory: string,
    prepend?: boolean
  },
  throwOnStderr?: boolean = true,
  allowEmptyStderr?: boolean = false,
  ignoreExitCode?: boolean
} // Also supports all options of child_process::spawn

type PromisedProcess = {
  then(callback: Function): Promise
  catch(callback: Function): Promise
  kill(signal: number)
}

export function exec(filePath: string, parameters: array, options: $OptionsAccepted): PromisedProcess
export function execNode(filePath: string, parameters: array, options: $OptionsAccepted): PromisedProcess

Explanation

Promise callbacks

  • then callback is supposed to accept one of these results, depending on options.stream:
    • stdout and stderr will result in a string, representing an stdout or stderr stream, respectively.
    • both will result in an object of {stdout, stderr, exitCode} representing their respective streams and an exit code of a process.
    • If options.stream is not provided it is assumed to be stdout, so a promise will result in a string representing an stdout stream.

options.local

options.local adds node executables in node_modules relative to options.local.directory to PATH like in npm scripts.

options.local.prepend prioritizes local executables over ones already in PATH.

License

This project is licensed under the terms of MIT License, see the LICENSE file for more info

Keywords

FAQs

Package last updated on 14 Apr 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc