Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #866 from enricomarino/patch-3
Browse files Browse the repository at this point in the history
feat: promisify node.init
  • Loading branch information
daviddias authored May 25, 2017
2 parents 7e21054 + e23c26f commit bd44b8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/components/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ const peerId = require('peer-id')
const waterfall = require('async/waterfall')
const parallel = require('async/parallel')
const isNode = require('detect-node')
const promisify = require('promisify-es6')

const addDefaultAssets = require('./init-assets')

module.exports = function init (self) {
return (opts, callback) => {
return promisify((opts, callback) => {
if (typeof opts === 'function') {
callback = opts
opts = {}
Expand Down Expand Up @@ -104,5 +105,5 @@ module.exports = function init (self) {
})
}
], done)
}
})
}

0 comments on commit bd44b8f

Please sign in to comment.