{"name":"@npmcli/disparity-colors","version":"3.0.1","keywords":["disparity","npm","npmcli","diff","char","unified","multiline","string","color","ansi","terminal","cli","tty"],"author":{"name":"GitHub Inc."},"license":"ISC","_id":"@npmcli/disparity-colors@3.0.1","maintainers":[{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"fritzy","email":"fritzy@github.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"contributors":[{"url":"https://ruyadorno.com","name":"Ruy Adorno"}],"homepage":"https://github.com/npm/disparity-colors#readme","bugs":{"url":"https://github.com/npm/disparity-colors/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"],"check-coverage":true},"dist":{"shasum":"042d5ef548200c81e3ee3a84c994744573fe79fd","tarball":"http://registry-npm.ywwl.com/@npmcli/disparity-colors/download/@npmcli/disparity-colors-3.0.1.tgz","fileCount":4,"integrity":"sha512-cOypTz/9IAhaPgOktbDNPeccTU88y8I1ZURbPeC0ooziK1h6dRJs2iGz1eKP1muaeVbow8GqQ0DaxLG8Bpmblw==","signatures":[{"sig":"MEUCIQD0O0mzU7g1UybR/6YemHihxjLGflGRQTIrsR5IiZmokwIgfoglwX409DYM0AjiqvtABbfzRsM3eZVhh5S0KHo+jDU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4750,"size":2337,"noattachment":false,"key":"/@npmcli/disparity-colors/-/@npmcli/disparity-colors-3.0.1.tgz"},"main":"lib/index.js","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"18e53a5a81bbb5e6fdcb38adac7f1d32aad90d18","scripts":{"lint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","pretest":"npm run lint","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"lukekarrys","email":"luke@lukekarrys.com"},"deprecated":"This package is no longer supported.","repository":{"url":"git+https://github.com/npm/disparity-colors.git","type":"git"},"_npmVersion":"10.7.0","description":"Colorizes unified diff output","directories":{},"templateOSS":{"version":"4.22.0","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"20.7.0","dependencies":{"ansi-styles":"^4.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","@npmcli/template-oss":"4.22.0","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/disparity-colors_3.0.1_1714786319762_0.6123090480204696","host":"s3://npm-registry-packages"},"readme":"# @npmcli/disparity-colors\n\n[![NPM version](https://img.shields.io/npm/v/@npmcli/disparity-colors)](https://www.npmjs.com/package/@npmcli/disparity-colors)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/npm/disparity-colors/ci.yml?branch=main)](https://github.com/npm/disparity-colors)\n[![License](https://img.shields.io/github/license/npm/disparity-colors)](https://github.com/npm/disparity-colors/blob/master/LICENSE)\n\nSpiritual sucessor to [disparity](https://www.npmjs.com/package/disparity). Colorizes [Diff Unified format](https://en.wikipedia.org/wiki/Diff#Unified_format) output using [ansi-styles](https://www.npmjs.com/package/ansi-styles).\n\n## Install\n\n`npm install @npmcli/disparity-colors`\n\n## Usage:\n\n```js\nconst colorize = require('@npmcli/disparity-colors')\nmapWorkspaces(`--- a/src/index.js\n+++ b/src/index.js\n@@ -1,4 +1,5 @@\n \"use strict\";\n+\"use foo\";\n\n const os = require(\"os\");\n`)\n// \u001b[33m--- a/src/index.js\u001b[39m\n// \u001b[33m+++ b/src/index.js\u001b[39m\n// \u001b[35m@@ -1,4 +1,5 @@\u001b[39m\n// \"use strict\";\n// \u001b[32m+\"use foo\";\u001b[39m\n// \n// const os = require(\"os\");\n```\n\n## API:\n\n### `colorize(str, opts = {}) -> String`\n\n- `str`: A [Diff Unified format](https://en.wikipedia.org/wiki/Diff#Unified_format) string\n- `opts`:\n  - `headerLength`: A **Number** defining how many lines should be colorized as header\n\n#### Returns\n\nA **String** including the appropriate [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)\n\n## LICENSE\n\n[ISC](./LICENSE)\n\n","publish_time":1714786319903,"_cnpm_publish_time":1714786319903,"dist-tags":{"latest":"3.0.1"}}