git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 49c6e5459b68f2a30bcecf7727b8c9a99cfe4e79

Files: 49c6e5459b68f2a30bcecf7727b8c9a99cfe4e79 / lib / module.js

447 bytesRaw
1const { set } = require('libnested')
2
3module.exports = Module
4
5function Module (definition) {
6 const { path, gives, needs, create } = definition
7 var module = { gives, needs, create }
8 if (!gives) {
9 module.gives = {}
10 set(module.gives, path, true)
11 module.create = (api) => {
12 const exports = create(api)
13 var globalExports = {}
14 set(globalExports, path, exports)
15 return globalExports
16 }
17 }
18 return module
19}
20

Built with git-ssb-web