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

dezalgo

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dezalgo

Contain async insanity so that the dark pony lord doesn't eat souls

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.6M
increased by4.52%
Maintainers
6
Weekly downloads
 
Created

What is dezalgo?

The dezalgo npm package ensures that a callback is always called asynchronously, and not in the same tick of the event loop that it was added in, even if it is already complete. This is useful for preventing stack overflows and ensuring consistent asynchronous behavior.

What are dezalgo's main functionalities?

Ensuring asynchronous callback execution

This feature wraps a callback function to ensure that it is always called on the next tick of the event loop, even if it could be called immediately.

const dezalgo = require('dezalgo')
const callback = dezalgo((err, data) => {
  // This will always run asynchronously
  console.log('Callback called asynchronously')
})

// Even if we call it synchronously, it will be deferred
callback(null, 'some data')

Other packages similar to dezalgo

Keywords

FAQs

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