How to use the callbackify function from util
Find comprehensive JavaScript util.callbackify code examples handpicked from public code repositorys.
GitHub: BridgeAR/node
29 30 31 32 33 34 35 36 37 38
const util = require('util'); async function fn() { return 'hello world'; } const callbackFunction = util.callbackify(fn); callbackFunction((err, ret) => { if (err) throw err; console.log(ret);
0
3
3
+ 3 other calls in file
GitHub: knex/knex
276 277 278 279 280 281 282 283 284 285 286
catch(...args) { return this._promise.catch(...args); } asCallback(cb) { callbackify(() => this._promise)(cb); return this._promise; } } finallyMixin(Transaction.prototype);
0
0
204
+ 3 other calls in file
GitHub: renxiuyi/branch_10
536 537 538 539 540 541 542 543 544 545
const { events } = buildConfiguration; events.on('configurePipeline', ({ pipeline }) => { pipeline.get('minify').push( // this is the "gulp-terser-js" wrapper around the latest version of terser through.obj( callbackify(async (file, _enc) => { const input = { [file.sourceMap.file]: file.contents.toString(), }; const opts = {
0
0
0
415 416 417 418 419 420 421 422 423 424 425
return DEFAULT_ASSIGNMENT } module.exports = { getPercentile, getAssignment: callbackify(getAssignment), getAssignmentForMongoUser: callbackify(getAssignmentForMongoUser), getAssignmentForUser: callbackify(getAssignmentForUser), getActiveAssignmentsForUser: callbackify(getActiveAssignmentsForUser), promises: {
0
0
0
+ 3 other calls in file
util.promisify is the most popular function in util (378 examples)