MCPcopy Index your code
hub / github.com/nodejs/node / logTar

Function logTar

deps/npm/lib/utils/tar.js:10–48  ·  view source on GitHub ↗
(tarball, { unicode = false, json, key, redact } = {})

Source from the content-addressed store, hash-verified

8})
9
10const logTar = (tarball, { unicode = false, json, key, redact } = {}) => {
11 if (json) {
12 const meta = redact === false ? { [META]: true, redact: false } : undefined
13 output.buffer(key == null ? tarball : { [key]: tarball }, meta)
14 return
15 }
16 log.notice('')
17 log.notice('', `${unicode ? '📦 ' : 'package:'} ${tarball.name}@${tarball.version}`)
18 log.notice('Tarball Contents')
19 if (tarball.files.length) {
20 log.notice(
21 '',
22 tarball.files.map(f =>
23 /^node_modules\//.test(f.path) ? null : `${formatBytes(f.size, false)} ${f.path}`
24 ).filter(f => f).join('\n')
25 )
26 }
27 if (tarball.bundled.length) {
28 log.notice('Bundled Dependencies')
29 tarball.bundled.forEach(name => log.notice('', name))
30 }
31 log.notice('Tarball Details')
32 log.notice('', `name: ${tarball.name}`)
33 log.notice('', `version: ${tarball.version}`)
34 if (tarball.filename) {
35 log.notice('', `filename: ${tarball.filename}`)
36 }
37 log.notice('', `package size: ${formatBytes(tarball.size)}`)
38 log.notice('', `unpacked size: ${formatBytes(tarball.unpackedSize)}`)
39 log.notice('', `shasum: ${tarball.shasum}`)
40 log.notice('', `integrity: ${tarball.integrity.toString().slice(0, 20)}[...]${tarball.integrity.toString().slice(80)}`)
41 if (tarball.bundled.length) {
42 log.notice('', `bundled deps: ${tarball.bundled.length}`)
43 log.notice('', `bundled files: ${tarball.entryCount - tarball.files.length}`)
44 log.notice('', `own files: ${tarball.files.length}`)
45 }
46 log.notice('', `total files: ${tarball.entryCount}`)
47 log.notice('', '')
48}
49
50const getContents = async (manifest, tarball) => {
51 const files = []

Callers 6

logPkgMethod · 0.85
#publishMethod · 0.85
execMethod · 0.85
execMethod · 0.85
printLogsFunction · 0.85
tar.jsFile · 0.85

Calls 9

formatBytesFunction · 0.70
filterMethod · 0.65
mapMethod · 0.65
forEachMethod · 0.65
sliceMethod · 0.65
bufferMethod · 0.45
joinMethod · 0.45
testMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…