Download node/node_modules/npm/lib/utils/output-error.js from codekingpro/portable-devtools: direct link, hf CLI and curl.
- Browser
- Download file 818 Bytes
-
https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/node/node_modules/npm/lib/utils/output-error.js
- Command line
-
hf download hf://datasets/codekingpro/portable-devtools@df58e70f9edde36aaca2d2aacc2440dd6c2f807d/node/node_modules/npm/lib/utils/output-error.js
-
curl -L -o output-error.js https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/node/node_modules/npm/lib/utils/output-error.js
818 Bytes
| const { log, output } = require('proc-log') | |
| const outputError = ({ standard = [], verbose = [], error = [], summary = [], detail = [] }) => { | |
| for (const line of standard) { | |
| // Each output line is just a single string | |
| output.standard(line) | |
| } | |
| for (const line of verbose) { | |
| log.verbose(...line) | |
| } | |
| for (const line of [...error, ...summary, ...detail]) { | |
| log.error(...line) | |
| } | |
| } | |
| const jsonError = (error, npm) => { | |
| if (error && npm?.loaded && npm?.config.get('json')) { | |
| return { | |
| code: error.code, | |
| summary: (error.summary || []).map(l => l.slice(1).join(' ')).join('\n').trim(), | |
| detail: (error.detail || []).map(l => l.slice(1).join(' ')).join('\n').trim(), | |
| ...error.json, | |
| } | |
| } | |
| } | |
| module.exports = { | |
| outputError, | |
| jsonError, | |
| } | |