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

bootman

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootman

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
43
decreased by-18.87%
Maintainers
1
Weekly downloads
 
Created
Source

Bootman

Start and stop services dependent on one another in order


Usage

1. Define Individual Services
// services/d.js
export default {
  dependsOn: ['a', 'b', 'c'], // Services which must be started prior to this service
  start: () => {}, // Start up function, called when this service is started
  stop: () => {} // Teardown function, called when this service is stopped
};
2. Initialize Bootman with Defined Services
// services/index.js
import bootman from 'bootman';
import a from 'services/a.js';
import b from 'services/b.js';
import c from 'services/c.js';
import d from 'services/d.js';

export default bootman({ a, b, c, d });
3. Start or Stop Services
Start
import services from 'services/index.js';

export default services.start(['d']);

/*
  In this particular example, since service d dependsOn services a, b, and c, 
  all three of those services must be in a "started" state before service d 
  will be started.

  The .start and .stop functions accepts either an individual name, i.e. 'd',
  an array of names, i.e. ['d', 'c', 'b', 'a'],
  or a set of names, i.e. new Set(['d', 'c', 'b', 'a']).
*/
Stop
// Stop a service
import services from 'services/index.js';

export default services.stop(['d']);

FAQs

Package last updated on 11 Apr 2022

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