• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1const Arborist = require('../')
2
3const printTree = require('./lib/print-tree.js')
4
5module.exports = (options, time) => new Arborist(options)
6  .loadActual(options)
7  .then(time)
8  .then(async ({ timing, result: tree }) => {
9    printTree(tree)
10    if (options.save) {
11      await tree.meta.save()
12    }
13    if (options.saveHidden) {
14      tree.meta.hiddenLockfile = true
15      tree.meta.filename = options.path + '/node_modules/.package-lock.json'
16      await tree.meta.save()
17    }
18    return `read ${tree.inventory.size} deps in ${timing.ms}`
19  })
20