{"versions":{"3.0.0":{"name":"@ioredis/as-callback","version":"3.0.0","description":"A performant and standard (Bluebird) library that registers a node-style callback on a promise","main":"built/index.js","types":"built/index.d.ts","directories":{"lib":"built"},"scripts":{"build":"rm -rf built && tsc","test":"npm run build && mocha","prepublishOnly":"npm test"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/ioredis/as-callback.git"},"keywords":["ascallback","nodeify","promise","bluebird"],"author":{"name":"Zihua Li","email":"i@zihua.li","url":"http://zihua.li"},"license":"MIT","bugs":{"url":"https://github.com/ioredis/as-callback/issues"},"homepage":"https://github.com/ioredis/as-callback#readme","devDependencies":{"mocha":"^9.2.2","promise-timeout":"^1.3.0","sinon":"^13.0.1","typescript":"^4.6.2"},"gitHead":"5039d4dc40b98e527064f05a81e24bc299f5dce5","_id":"@ioredis/as-callback@3.0.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Kqv1rZ3WbgOrS+hgzJ5xG5WQuhvzzSTRYvNeyPMLOAM78MHSnuKI20JeJGbpuAt//LCuP0vsexZcorqW7kWhJg==","shasum":"b96c9b05e6701e85ec6a5e62fa254071b0aec97f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@ioredis/as-callback/-/as-callback-3.0.0.tgz","fileCount":9,"unpackedSize":5958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNX9QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHmQ/+KQiJdS/H5sYLsy5fOdZLd9059WBduzBt2pa/yBJ5yR1QOCJG\r\nlRWTpysyFcv+Dc536LSvt30tGdklPPn+U5h+n5PVcNHqirDBygkKoJofvp0t\r\npB0lXlzycO0s/YSz/Hk/rpDtx27G1kQ0v6VpvuPv8VaQUGh6xaA6lRJ78BOv\r\nwqAstCouu/kll13s1p8STmvR00hlY/w948JTHf8bxRjBymbKX+UlfS4irAMF\r\nFT37gIgQMIzwGOLUanKDSmplUn7pJPH7840s1+UwToOjFCXTwoMLapKdoEZ8\r\nssQZ6fEEmnfIqKD72yHCNmNm58LEIZVLq3wiA+yP6z8KSlvHHjOIcADdSW8p\r\nCluSMaXB3lSKeF/J1ZStb2DkmT6/wIKAHg7wG9/1CkDb1YmxnWSKLRhg/FZf\r\njLDv3sWJnUfg69ROF0rNwVn6HoLFEdPt2xncFer+mP9fE2UElDy/t/2N5bMp\r\nwJLlm4zbc4PCXtjFiU8e4wToRYpar043sBkkgkVlUQMiZgQ65Up/zqcnKTHP\r\nZIgMlHNmDseW5Pg2hh7WBRj3rJx8TCV9BTfIwwNS9TPb8qkAYaVhkIvvD1r8\r\nPqfaS7PQNWv3nD1Ap8VeVyUSOpbVIUrZjztMklOGwUr2OSNxS6LVLHMwA2U0\r\nWlb4PJM6uFEBJTwOz0omu+aGzqqfuqZphiM=\r\n=hWMO\r\n-----END PGP SIGNATURE-----\r\n","size":2758},"_npmUser":{"name":"anonymous","email":"i@zihua.li"},"maintainers":[{"name":"anonymous","email":"ioredis-robot@zihua.li"},{"name":"anonymous","email":"i@zihua.li"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/as-callback_3.0.0_1647673168616_0.7282688474929084"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-19T06:59:33.893Z","contributors":[]}},"dist-tags":{"latest":"3.0.0"},"name":"@ioredis/as-callback","time":{"created":"2022-03-19T06:59:39.222Z","modified":"2025-09-17T15:29:57.169Z","3.0.0":"2022-03-19T06:59:28.761Z"},"readme":"# Standard asCallback\nA performant and standard (Bluebird) library that registers a node-style callback on a promise. It's used by [ioredis](https://github.com/luin/ioredis).\n\n[![Build Status](https://github.com/ioredis/as-callback/workflows/Test/badge.svg)](https://github.com/ioredis/as-callback/actions?query=workflow%3ATest+branch%3Amaster) [![npm latest version](https://img.shields.io/npm/v/@ioredis/as-callback/latest.svg)](https://www.npmjs.com/package/@ioredis/as-callback)\n\n\n## Install\n\n```\n$ npm install @ioredis/as-callback\n```\n\n## Usage\n\n```javascript\nconst asCallback = require('@ioredis/as-callback').defaults;\n\nconst promise = new Promise(function (resolve) {\n  setTimeout(function () {\n    resolve('hello world!')\n  }, 1000)\n})\n\nasCallback(promise, function callback (err, res) {\n  console.log(err, res) // null, 'hello world!'\n})\n```\n\n## Motivation\nThere 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.\n\n## Thanks\n\nMost code of this library are ported from the awesome Bluebird library.\n\n## License\nThe MIT License.","users":{}}