A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/cli/commit/9216d5985fb3e2a2754be5bf0b1d43fc321cf723 below:

better output colors (#7377) · npm/cli@9216d59 · GitHub

@@ -318,125 +318,89 @@ class View extends BaseCommand {

318 318

// More modern, pretty printing of default view

319 319

const unicode = this.npm.config.get('unicode')

320 320

const chalk = this.npm.chalk

321 -

const tags = []

322 - 323 -

Object.keys(packu['dist-tags']).forEach((t) => {

324 -

const version = packu['dist-tags'][t]

325 -

tags.push(`${chalk.bold.green(t)}: ${version}`)

326 -

})

327 -

const unpackedSize = manifest.dist.unpackedSize &&

328 -

formatBytes(manifest.dist.unpackedSize, true)

321 +

const deps = Object.keys(manifest.dependencies || {}).map((dep) =>

322 +

`${chalk.blue(dep)}: ${manifest.dependencies[dep]}`

323 +

)

324 +

const site = manifest.homepage?.url || manifest.homepage

325 +

const bins = Object.keys(manifest.bin || {})

329 326

const licenseField = manifest.license || 'Proprietary'

330 -

const info = {

331 -

name: chalk.green(manifest.name),

332 -

version: chalk.green(manifest.version),

333 -

bins: Object.keys(manifest.bin || {}),

334 -

versions: chalk.yellow(packu.versions.length + ''),

335 -

description: manifest.description,

336 -

deprecated: manifest.deprecated,

337 -

keywords: packu.keywords || [],

338 -

license: typeof licenseField === 'string'

339 -

? licenseField

340 -

: (licenseField.type || 'Proprietary'),

341 -

deps: Object.keys(manifest.dependencies || {}).map((dep) => {

342 -

return `${chalk.yellow(dep)}: ${manifest.dependencies[dep]}`

343 -

}),

344 -

publisher: manifest._npmUser && unparsePerson({

345 -

name: chalk.yellow(manifest._npmUser.name),

346 -

email: chalk.cyan(manifest._npmUser.email),

347 -

}),

348 -

modified: !packu.time ? undefined

349 -

: chalk.yellow(relativeDate(packu.time[manifest.version])),

350 -

maintainers: (packu.maintainers || []).map((u) => unparsePerson({

351 -

name: chalk.yellow(u.name),

352 -

email: chalk.cyan(u.email),

353 -

})),

354 -

repo: (

355 -

manifest.bugs && (manifest.bugs.url || manifest.bugs)

356 -

) || (

357 -

manifest.repository && (manifest.repository.url || manifest.repository)

358 -

),

359 -

site: (

360 -

manifest.homepage && (manifest.homepage.url || manifest.homepage)

361 -

),

362 -

tags,

363 -

tarball: chalk.cyan(manifest.dist.tarball),

364 -

shasum: chalk.yellow(manifest.dist.shasum),

365 -

integrity:

366 -

manifest.dist.integrity && chalk.yellow(manifest.dist.integrity),

367 -

fileCount:

368 -

manifest.dist.fileCount && chalk.yellow(manifest.dist.fileCount),

369 -

unpackedSize: unpackedSize && chalk.yellow(unpackedSize),

370 -

}

371 -

if (info.license.toLowerCase().trim() === 'proprietary') {

372 -

info.license = chalk.bold.red(info.license)

373 -

} else {

374 -

info.license = chalk.green(info.license)

375 -

}

327 +

const license = typeof licenseField === 'string'

328 +

? licenseField

329 +

: (licenseField.type || 'Proprietary')

376 330 377 331

output.standard('')

378 -

output.standard(

379 -

chalk.underline.bold(`${info.name}@${info.version}`) +

380 -

' | ' + info.license +

381 -

' | deps: ' + (info.deps.length ? chalk.cyan(info.deps.length) : chalk.green('none')) +

382 -

' | versions: ' + info.versions

383 -

)

384 -

info.description && output.standard(info.description)

385 -

if (info.repo || info.site) {

386 -

info.site && output.standard(chalk.cyan(info.site))

332 +

output.standard([

333 +

chalk.underline.cyan(`${manifest.name}@${manifest.version}`),

334 +

license.toLowerCase().trim() === 'proprietary'

335 +

? chalk.red(license)

336 +

: chalk.green(license),

337 +

`deps: ${deps.length ? chalk.cyan(deps.length) : chalk.cyan('none')}`,

338 +

`versions: ${chalk.cyan(packu.versions.length + '')}`,

339 +

].join(' | '))

340 + 341 +

manifest.description && output.standard(manifest.description)

342 +

if (site) {

343 +

output.standard(chalk.blue(site))

387 344

}

388 345 389 -

const warningSign = unicode ? ' ⚠️ ' : '!!'

390 -

info.deprecated && output.standard(

391 -

`\n${chalk.bold.red('DEPRECATED')}${

392 -

warningSign

393 -

} - ${info.deprecated}`

346 +

manifest.deprecated && output.standard(

347 +

`\n${chalk.redBright('DEPRECATED')}${unicode ? ' ⚠️ ' : '!!'} - ${manifest.deprecated}`

394 348

)

395 349 396 -

if (info.keywords.length) {

397 -

output.standard('')

398 -

output.standard(`keywords: ${chalk.yellow(info.keywords.join(', '))}`)

350 +

if (packu.keywords?.length) {

351 +

output.standard(`\nkeywords: ${

352 +

packu.keywords.map(k => chalk.cyan(k)).join(', ')

353 +

}`)

399 354

}

400 355 401 -

if (info.bins.length) {

402 -

output.standard('')

403 -

output.standard(`bin: ${chalk.yellow(info.bins.join(', '))}`)

356 +

if (bins.length) {

357 +

output.standard(`\nbin: ${chalk.cyan(bins.join(', '))}`)

404 358

}

405 359 406 -

output.standard('')

407 -

output.standard('dist')

408 -

output.standard(`.tarball: ${info.tarball}`)

409 -

output.standard(`.shasum: ${info.shasum}`)

410 -

info.integrity && output.standard(`.integrity: ${info.integrity}`)

411 -

info.unpackedSize && output.standard(`.unpackedSize: ${info.unpackedSize}`)

412 - 413 -

const maxDeps = 24

414 -

if (info.deps.length) {

415 -

output.standard('')

416 -

output.standard('dependencies:')

417 -

output.standard(columns(info.deps.slice(0, maxDeps), { padding: 1 }))

418 -

if (info.deps.length > maxDeps) {

419 -

output.standard(`(...and ${info.deps.length - maxDeps} more.)`)

360 +

output.standard('\ndist')

361 +

output.standard(`.tarball: ${chalk.blue(manifest.dist.tarball)}`)

362 +

output.standard(`.shasum: ${chalk.green(manifest.dist.shasum)}`)

363 +

if (manifest.dist.integrity) {

364 +

output.standard(`.integrity: ${chalk.green(manifest.dist.integrity)}`)

365 +

}

366 +

if (manifest.dist.unpackedSize) {

367 +

output.standard(`.unpackedSize: ${chalk.blue(formatBytes(manifest.dist.unpackedSize, true))}`)

368 +

}

369 + 370 +

if (deps.length) {

371 +

const maxDeps = 24

372 +

output.standard('\ndependencies:')

373 +

output.standard(columns(deps.slice(0, maxDeps), { padding: 1 }))

374 +

if (deps.length > maxDeps) {

375 +

output.standard(chalk.dim(`(...and ${deps.length - maxDeps} more.)`))

420 376

}

421 377

}

422 378 423 -

if (info.maintainers && info.maintainers.length) {

424 -

output.standard('')

425 -

output.standard('maintainers:')

426 -

info.maintainers.forEach((u) => output.standard(`- ${u}`))

379 +

if (packu.maintainers?.length) {

380 +

output.standard('\nmaintainers:')

381 +

packu.maintainers.forEach(u =>

382 +

output.standard(`- ${unparsePerson({

383 +

name: chalk.blue(u.name),

384 +

email: chalk.dim(u.email) })}`)

385 +

)

427 386

}

428 387 429 -

output.standard('')

430 -

output.standard('dist-tags:')

431 -

output.standard(columns(info.tags))

388 +

output.standard('\ndist-tags:')

389 +

output.standard(columns(Object.keys(packu['dist-tags']).map(t =>

390 +

`${chalk.blue(t)}: ${packu['dist-tags'][t]}`

391 +

)))

432 392 433 -

if (info.publisher || info.modified) {

393 +

const publisher = manifest._npmUser && unparsePerson({

394 +

name: chalk.blue(manifest._npmUser.name),

395 +

email: chalk.dim(manifest._npmUser.email),

396 +

})

397 +

if (publisher || packu.time) {

434 398

let publishInfo = 'published'

435 -

if (info.modified) {

436 -

publishInfo += ` ${info.modified}`

399 +

if (packu.time) {

400 +

publishInfo += ` ${chalk.cyan(relativeDate(packu.time[manifest.version]))}`

437 401

}

438 -

if (info.publisher) {

439 -

publishInfo += ` by ${info.publisher}`

402 +

if (publisher) {

403 +

publishInfo += ` by ${publisher}`

440 404

}

441 405

output.standard('')

442 406

output.standard(publishInfo)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4