Looking for node.js Answers? Try Ask4KnowledgeBase
Looking for node.js Keywords? Try Ask4Keywords

Node.jsCreating a Node.js Library that Supports Both Promises and Error-First Callbacks


Introduction

Many people like working with promises and/or async/await syntax, but when writing a module it would be useful to some programmers to support classic callback style methods as well. Rather than creating two modules, or two sets of functions, or having the programmer promisify your module, your module can support both programming methods at one using bluebird's asCallback() or Q's nodeify().