Skip to content

Instantly share code, notes, and snippets.

View colceagus's full-sized avatar

Daniel C colceagus

  • Bucharest
View GitHub Profile
@colceagus
colceagus / test-promisify.js
Created October 1, 2016 23:16
Example of function with callback that returns a promise. Can use both promise chaining and callback.
'use strict';
var q = require('q');
function promisifyme(value, callback) {
var deferred = q.defer();
if (value === 3) {
deferred.resolve(123);
}