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

@darkobits/adeiu

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@darkobits/adeiu

Yet another POSIX signal handler.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48
decreased by-72.88%
Maintainers
1
Weekly downloads
 
Created
Source

Yet another POSIX signal handler.

Features

  • Runs any combination of synchronous and asynchronous callbacks concurrently.
  • Ensures a clean exit if all callbacks resolve/return.
  • Exit with an error if any callbcks reject/throw.
  • Ensures processes exit cleanly, even when they have asynchronous callbacks and the Node debugger is in use. (See this issue.

Install

npm i @darkobits/adeiu

Use

import adeiu from '@darkobits/adeiu';

// Register a callback.
const annuler = adeiu(async signal => {
  console.log(`Hey, we got ${signal}. Exiting...`);

  await someAsyncStuff();

  console.log('All done!');
});

// Unregister the callack.
annuler();

Keywords

FAQs

Package last updated on 18 Apr 2019

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