PHP 8.2.30
Preview: log-shim.js Size: 1.68 KB
/proc/self/root/proc/self/root/opt/alt/alt-nodejs16/root/usr/lib/node_modules/npm/lib/utils/log-shim.js

const NPMLOG = require('npmlog')
const PROCLOG = require('proc-log')

// Sets getter and optionally a setter
// otherwise setting should throw
const accessors = (obj, set) => (k) => ({
  get: () => obj[k],
  set: set ? (v) => (obj[k] = v) : () => {
    throw new Error(`Cant set ${k}`)
  },
})

// Set the value to a bound function on the object
const value = (obj) => (k) => ({
  value: (...args) => obj[k].apply(obj, args),
})

const properties = {
  // npmlog getters/setters
  level: accessors(NPMLOG, true),
  heading: accessors(NPMLOG, true),
  levels: accessors(NPMLOG),
  gauge: accessors(NPMLOG),
  stream: accessors(NPMLOG),
  tracker: accessors(NPMLOG),
  progressEnabled: accessors(NPMLOG),
  // npmlog methods
  useColor: value(NPMLOG),
  enableColor: value(NPMLOG),
  disableColor: value(NPMLOG),
  enableUnicode: value(NPMLOG),
  disableUnicode: value(NPMLOG),
  enableProgress: value(NPMLOG),
  disableProgress: value(NPMLOG),
  clearProgress: value(NPMLOG),
  showProgress: value(NPMLOG),
  newItem: value(NPMLOG),
  newGroup: value(NPMLOG),
  // proclog methods
  notice: value(PROCLOG),
  error: value(PROCLOG),
  warn: value(PROCLOG),
  info: value(PROCLOG),
  verbose: value(PROCLOG),
  http: value(PROCLOG),
  silly: value(PROCLOG),
  pause: value(PROCLOG),
  resume: value(PROCLOG),
}

const descriptors = Object.entries(properties).reduce((acc, [k, v]) => {
  acc[k] = { enumerable: true, ...v(k) }
  return acc
}, {})

// Create an object with the allowed properties rom npm log and all
// the logging methods from proc log
// XXX: this should go away and requires of this should be replaced with proc-log + new display
module.exports = Object.freeze(Object.defineProperties({}, descriptors))

Directory Contents

Dirs: 2 × Files: 32

Name Size Perms Modified Actions
- drwxr-xr-x 2026-04-08 07:02:22
Edit Download
config DIR
- drwxr-xr-x 2026-04-08 07:02:22
Edit Download
173 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
978 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
2.46 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.85 KB lrwxr-xr-x 2026-03-17 06:55:03
Edit Download
1.46 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
2.84 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
12.64 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
6.77 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
3.73 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
2.56 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
629 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
3.93 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
740 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
233 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
7.64 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.68 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.95 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.54 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.17 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.23 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
252 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
412 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
9.58 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1.99 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
876 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
4.96 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
807 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
3.73 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
3.18 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
4.45 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
1023 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download
558 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).