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

bee-hive

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-hive

Spawn, manage and monitor multiple node.js child_process-es with ease.

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Travis CI badge

BEE-HIVE

The stupid dash in the name was because beehive is another package I hadn't known existed before starting this. Yeah, lessons learned, thanks.


BEE-HIVE lets you launches, tag, monitor and manage multiple node.js ChildProcess(es) with ease.

Install and put in your package.json with:

$ npm install bee-hive --save

!!! Not to be confused with the beehive (without the dash) package !!!

API

new require('bee-hive').Hive() || require('bee-hive').createHive()

Creates a new Hive to manage your process.

hive.launch( [tag], cmd )

Launch a process and give it a tag for later reference.

hive.processes[ tag ] || hive.get( tag )

Gets the wrapped ChildProcess object from the hive.

hive.tags()

Returns all the tags in the hive.

hive.all()

Returns all the processes launched via the hive.

hive.remove( tag )

Removes a tagged process from the hive. Does not kill the process.

hive.clear()

Removes all processes from the hive. Does not kill any process.

hive.kill( tag, [signal] )

Sends the tagged process the given kill signal. Signal defaults to node's child.kill() defaults.

hive.killall( [signal] )

Kill all processes in the hive with the given signal.

EXTRAS

require('bee-hive').Bee

Bee class, which is what is used by the hive to wrap node.js native ChildProcess object.

new Bee( childProc )

Wraps the given node.js native ChildProcess object.

bee.stdin, bee.stdout, bee.stderr

Bee wraps ChildProcess's stdin, stdout and stderr in a PeekStream which provides a window property that has the last few bytes that was emitted from the stream.

Very handy for logging and instrospection. i.e. see the last few lines from stderr when the process dies.

Otherwise the stream should behaves the same as any ChildProcess stream.

bee.state

Bee listens for ChildProcess's close and exit event automatically on wraps and will set this property to close and exit respectively when the event happens.

A new bee should have an open state initially.

bee.proc

The originally wrapped process.

SEE ALSO

  • peekstream` - which provides the windowing feature.

LICENSE

BSD

SUPPORT / CONTRIBUTE

Just ping me @chakrit on twitter. Or just file a new GitHub issue

Pull requests also welcome! :)

Keywords

FAQs

Package last updated on 08 Dec 2012

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