How to use the fromNode function from bluebird

Find comprehensive JavaScript bluebird.fromNode code examples handpicked from public code repositorys.

66
67
68
69
70
71
72
73
74
75
  throw err
} else {
  return readPackageTree(npm.localPrefix).then(
    id.computeMetadata
  ).then((tree) => {
    return BB.fromNode((cb) => {
      createShrinkwrap(tree, {
        silent,
        defaultFile: SHRINKWRAP
      }, cb)
fork icon0
star icon0
watch icon1

0
1
2
3
4
5
6
7
8
9
10
11
'use strict'


const BB = require('bluebird')


module.exports = function (child, hasExitCode = false) {
  return BB.fromNode(function (cb) {
    child.on('error', cb)
    child.on(hasExitCode ? 'close' : 'end', function (exitCode) {
      if (exitCode === undefined || exitCode === 0) {
        cb()
fork icon0
star icon0
watch icon1

+ 8 other calls in file

195
196
197
198
199
200
201
202
203
204
    data.version = version
    return BB.all(
      results.map((v) => prettyView(data, v[Object.keys(v)[0]][''], opts))
    ).then(() => retval)
  } else {
    return BB.fromNode(cb => {
      printData(retval, data._id, opts, cb)
    }).then(() => retval)
  }
}).nodeify(cb)
fork icon0
star icon0
watch icon1

+ 6 other calls in file