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

@ioredis/as-callback

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ioredis/as-callback

A performant and standard (Bluebird) library that registers a node-style callback on a promise

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Standard asCallback

A performant and standard (Bluebird) library that registers a node-style callback on a promise. It's used by ioredis.

Build Status npm latest version

Install

$ npm install @ioredis/as-callback

Usage

const asCallback = require('@ioredis/as-callback').defaults;

const promise = new Promise(function (resolve) {
  setTimeout(function () {
    resolve('hello world!')
  }, 1000)
})

asCallback(promise, function callback (err, res) {
  console.log(err, res) // null, 'hello world!'
})

Motivation

There are many libraries serve similar functionality. However, none of them I'd found are exactly the same as Bluebird's asCallback function (in terms of either performance or functionality). Thus this library comes out.

Thanks

Most code of this library are ported from the awesome Bluebird library.

License

The MIT License.

Keywords

FAQs

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