Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cross-spawn-with-kill

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-spawn-with-kill

Adds cross-platform `kill` function to cross-spawn processes

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-0.84%
Maintainers
1
Weekly downloads
 
Created
Source

cross-spawn-with-kill

Adds cross-platform kill function to cross-spawn processes

Build Status Code Coverage Dependencies version downloads MIT License

All Contributors PRs Welcome Donate Code of Conduct Roadmap Examples

Watch on GitHub Star on GitHub Tweet

The problem

cross-spawn is a cross platform solution to node's spawn. However, it doesn't provide a mechanism for "killing" the process after it's begun (in a cross platform manner).

This solution

This solution provides a kill function on the child returned from spawn which will kill the corresponding process when invoked. It does not work with spawn.sync as the process will be finished before your code could run anyway.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

npm install --save cross-spawn-with-kill

Usage

const spawn = require('cross-spawn-with-kill')
const child = spawn('webpack')
child.kill() // <-- that's the ✨ magic ✨ extra function

Inspiration

Big thank you goes to @mysticatea for his original work on npm-run-all from which this project was derived.

Other Solutions

There are none that I'm aware of. The issue on cross-spawn requesting this feature was rejected. Hence the creation of this module.

Contributors

Thanks goes to these people (emoji key):


Kent C. Dodds

💻 📖 🚇 ⚠️

Toru Nagashima

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT

FAQs

Package last updated on 02 Sep 2016

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