HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //opt/alt/alt-nodejs11/root/usr/lib/node_modules/npm/lib/install/update-package-json.js
'use strict'
var path = require('path')
var writeFileAtomic = require('write-file-atomic')
var moduleName = require('../utils/module-name.js')
var deepSortObject = require('../utils/deep-sort-object.js')
var sortedObject = require('sorted-object')
var isWindows = require('../utils/is-windows.js')

var sortKeys = [
  'dependencies', 'devDependencies', 'bundleDependencies',
  'optionalDependencies', 'keywords', 'engines', 'scripts',
  'files'
]

module.exports = function (mod, buildpath, next) {
  var pkg = sortedObject(mod.package)
  var name = moduleName(mod)
  // Add our diagnostic keys to the package.json.
  // Note that there are folks relying on these, for ex, the Visual Studio
  // Node.js addon.
  pkg._requiredBy =
    mod.requiredBy
      .map(function (req) {
        if (
          req.package.devDependencies &&
          req.package.devDependencies[name] &&
          !req.package.dependencies[name]
        ) {
          return '#DEV:' + req.location
        } else {
          return req.location
        }
      })
      .concat(mod.userRequired ? ['#USER'] : [])
      .sort()
  pkg._location = mod.location
  pkg._phantomChildren = {}
  Object.keys(mod.phantomChildren).sort().forEach(function (name) {
    pkg._phantomChildren[name] = mod.phantomChildren[name].package.version
  })
  pkg._inBundle = !!mod.fromBundle

  // sort keys that are known safe to sort to produce more consistent output
  sortKeys.forEach(function (key) {
    if (pkg[key] != null) pkg[key] = deepSortObject(pkg[key])
  })

  var data = JSON.stringify(sortedObject(pkg), null, 2) + '\n'

  writeFileAtomic(path.resolve(buildpath, 'package.json'), data, {
    // We really don't need this guarantee, and fsyncing here is super slow. Except on
    // Windows where there isn't a big performance difference and it prevents errors when
    // rolling back optional packages (#17671)
    fsync: isWindows
  }, next)
}