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

Commit bd44b8f

Browse files
authored
Merge pull request #866 from enricomarino/patch-3
feat: promisify node.init
2 parents 7e21054 + e23c26f commit bd44b8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/components/init.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ const peerId = require('peer-id')
44
const waterfall = require('async/waterfall')
55
const parallel = require('async/parallel')
66
const isNode = require('detect-node')
7+
const promisify = require('promisify-es6')
78

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

1011
module.exports = function init (self) {
11-
return (opts, callback) => {
12+
return promisify((opts, callback) => {
1213
if (typeof opts === 'function') {
1314
callback = opts
1415
opts = {}
@@ -104,5 +105,5 @@ module.exports = function init (self) {
104105
})
105106
}
106107
], done)
107-
}
108+
})
108109
}

0 commit comments

Comments
 (0)