0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.20.172


Current Path : /proc/thread-self/root/usr/share/npm/lib/install/
Upload File :
Current File : //proc/thread-self/root/usr/share/npm/lib/install/update-package-json.js

'use strict'
var path = require('path')
var writeFileAtomic = require('write-file-atomic')
var deepSortObject = require('../utils/deep-sort-object.js')

module.exports = function (pkg, buildpath, next) {
  // FIXME: This bundled dance is because we're sticking a big tree of bundled
  // deps into the parsed package.json– it probably doesn't belong there =/
  // But the real reason we don't just dump it out is that it's the result
  // of npm-read-tree, which produces circular data structures, due to the
  // parent and children keys.
  var bundled = pkg.package._bundled
  delete pkg.package._bundled // FIXME
  var packagejson = deepSortObject(pkg.package)
  var data = JSON.stringify(packagejson, null, 2) + '\n'
  pkg.package._bundled = bundled
  writeFileAtomic(path.resolve(buildpath, 'package.json'), data, next)
}