Socket
Socket
Sign inDemoInstall

@npmcli/disparity-colors

Package Overview
Dependencies
3
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @npmcli/disparity-colors

Colorizes unified diff output


Version published
Weekly downloads
419K
decreased by-3.19%
Maintainers
5
Install size
54.3 kB
Created
Weekly downloads
 

Changelog

Source

3.0.1 (2024-05-03)

Documentation

Chores

  • 6354487 #74 bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
  • 8ee3786 #27 bump @npmcli/eslint-config from 3.1.0 to 4.0.0 (@dependabot[bot])
  • 23e8a93 #74 postinstall for dependabot template-oss PR (@lukekarrys)
  • 9438024 #72 bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])

Readme

Source

@npmcli/disparity-colors

NPM version Build Status License

Spiritual sucessor to disparity. Colorizes Diff Unified format output using ansi-styles.

Install

npm install @npmcli/disparity-colors

Usage:

const colorize = require('@npmcli/disparity-colors')
mapWorkspaces(`--- a/src/index.js
+++ b/src/index.js
@@ -1,4 +1,5 @@
 "use strict";
+"use foo";

 const os = require("os");
`)
// --- a/src/index.js
// +++ b/src/index.js
// @@ -1,4 +1,5 @@
// "use strict";
// +"use foo";
// 
// const os = require("os");

API:

colorize(str, opts = {}) -> String

  • str: A Diff Unified format string
  • opts:
    • headerLength: A Number defining how many lines should be colorized as header
Returns

A String including the appropriate ANSI escape codes

LICENSE

ISC

Keywords

FAQs

Last updated on 04 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc