Welcome to mirror list, hosted at ThFree Co, Russian Federation.

actual.js « bin « arborist « workspaces - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 866b2cd82fa4734cbc2d458c227caa14668170c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const Arborist = require('../')

const printTree = require('./lib/print-tree.js')

module.exports = (options, time) => new Arborist(options)
  .loadActual(options)
  .then(time)
  .then(async ({ timing, result: tree }) => {
    printTree(tree)
    if (options.save) {
      await tree.meta.save()
    }
    if (options.saveHidden) {
      tree.meta.hiddenLockfile = true
      tree.meta.filename = options.path + '/node_modules/.package-lock.json'
      await tree.meta.save()
    }
    return `read ${tree.inventory.size} deps in ${timing.ms}`
  })