mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-04-01 23:31:17 +00:00
12 lines
248 B
JavaScript
12 lines
248 B
JavaScript
'use strict'
|
|
|
|
// Based on npmjs.com/nodeify but without additional `nextTick` calls
|
|
// to keep the overhead low
|
|
module.exports = function nodeify (promise, cb) {
|
|
return promise.then((res) => {
|
|
cb(null, res)
|
|
}, (err) => {
|
|
cb(err)
|
|
})
|
|
}
|