Socket
Book a DemoInstallSign in
Socket

crony

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crony

Node.js library for implementing supervisord event listeners

0.5.0
latest
Source
npmnpm
Version published
Weekly downloads
1
-66.67%
Maintainers
3
Weekly downloads
 
Created
Source

crony

Build Status

Node.js library for implementing supervisord event listeners.

Requires Node.js 6+

What?

supervisord implements an event API for listening to changes in state for the processes it manages. crony is an EventEmitter that lets us do stuff with those events in JavaScript.

Usage

const crony = require('crony');

crony.on( 'event', ev => {
  // Global event handler

  // token set for the event headers
  console.log(`Headers: ${ ev.headers }`);

  // token set for the event payload
  console.log(`Payload: ${ ev.payload }`);

  // If there was an event body, we pass that along, otherwise its undefined
  console.log(`Body: ${ ev.body }`);

  // We also preserve the raw event string
  console.log(`Raw: ${ ev.raw }`);
});

// Additionally, we can also listen to specific events
crony.on( 'PROCESS_STATE_RUNNING', ev => {
  // ...
});

// Start listening for events
crony.listen();

Development

# Install dependencies
nvm install
npm install

# Run the linter and tests
npm test

Keywords

supervisord

FAQs

Package last updated on 10 Sep 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.