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

easy-fork

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-fork

Easyly fork node process to run scripts concurrently

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

easy-fork Build Status codecov

Easily fork node process to run scripts concurrently

Why

Sometimes you want to run multiple node processes at once. For example

  • Type-checking command like tsc --project src
  • Bundler command like parcel src --out-dir build
  • Server starting command like onchange build --initial -- node build/start.js

There are several ways to solve this:

  • Make npm/yarn scripts and run them independently

    • Probably the "healthy" way. But it is annoying to open terminals and run these command one by one.
  • Gulp

    • Using exposed APIs is usually takes more effort than CLI commands.
  • command1 & command2 & command3 & ...

    • Sending SIGTERM does not kill all processes.

With easy-fork, you can pass multiple CLI commands to run them concurrently, and now all you have to do is run the script.

Install

$ npm install easy-fork

or

$ yarn add easy-fork

Usage

const fork = require('easy-fork');

fork('tsc --watch --project ./src/client');
fork('tsc --watch --project ./src/server');
fork('parcel serve ./src/client/index.html --out-dir ./build/client');
fork('tcm --watch --camelCase --pattern ./src/client/**/*.scss')
fork('onchange ./build/server --initial -- node ./build/server')

API

easyFork(command)

command

Type: string

Command to run. Must be locally installed node CLI.

License

MIT © Hoishin

Keywords

FAQs

Package last updated on 01 Sep 2018

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