How to use the fromCallback function from bluebird
Find comprehensive JavaScript bluebird.fromCallback code examples handpicked from public code repositorys.
203 204 205 206 207 208 209 210 211 212 213exports.editFile = function (str) { var pattern = Path.join(os.tmpdir(),'XXXXXX.yaml'); var tmpfile = mktemp(pattern); fs.writeFileSync(tmpfile, str); return Promise.fromCallback(function (promiseCb) { editor(tmpfile, function (code) { if (code !== 0) return promiseCb(Error('Editor closed with code ' + code));
+ 3 other calls in file
14 15 16 17 18 19 20 21 22 23 24 25require('../../server/event-listeners').install(); function getKeys() { var redisClient = redis.getClient(); return Promise.fromCallback(function(callback) { return redisClient.keys('unread:chat:*', callback); }); }
+ 2 other calls in file
GitHub: sindeshiva/Test
5 6 7 8 9 10 11 12 13 14 15const { allowDestroy } = require('@packages/network') const systemTests = require('../lib/system-tests').default // create an HTTPS server that forces TLSv1 const startTlsV1Server = (port) => { return Bluebird.fromCallback((cb) => { const opts = _.merge({ secureProtocol: 'TLSv1_server_method', }, cert)
254 255 256 257 258 259 260 261 262 263// about how Chrome does it. context.skip('Google Chrome', () => { const testRetries = (path) => { return launchBrowser(`http://127.0.0.1:${PORT}${path}`) .then((proc) => { return Promise.fromCallback((cb) => { return onVisit = function () { if (counts[path] >= 3) { return cb() }
+ 3 other calls in file
GitHub: sindeshiva/Test
317 318 319 320 321 322 323 324 325close () { const close = () => { const servers = _.values(sslIpServers).concat(this._sniServer) return Promise.map(servers, (server) => { return Promise.fromCallback(server.destroy) .catch(onError) }) }
GitHub: sindeshiva/Test
242 243 244 245 246 247 248 249 250 251stream.on('retry', () => { retries++ }) const p = Bluebird.fromCallback((cb) => { stream.on('error', cb) }) return expect(p).to.be.rejected
+ 11 other calls in file
GitHub: sindeshiva/Test
169 170 171 172 173 174 175 176 177} redirectToStatus('error') }) return new Promise.fromCallback((cb) => { server = app.listen(0, '127.0.0.1', cb) }) }
+ 3 other calls in file
bluebird.reject is the most popular function in bluebird (2988 examples)