UNPKG

reg

Version:

`reg` is a package manager for native ES Modules. It's built to enable dependency management for Universal JavaScript (JavaScript that can run in the Browser and in Node.js w/o a compiler).

19 lines (17 loc) 417 B
const createTypes = require('./types.js') const linker = require('./linker.js') const push = async (file, putBlock) => { const types = createTypes({ codec: 'dag-json' }) const puts = [] let pkg for await (let { block, root } of linker(file)) { if (root) { block = root.block() pkg = root } puts.push(putBlock(block)) } await Promise.all(puts) return pkg } module.exports = push