Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@npmcli/disparity-colors

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@npmcli/disparity-colors

Colorizes unified diff output

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
204K
decreased by-44.95%
Maintainers
5
Weekly downloads
 
Created
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

Package last updated on 22 May 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc