Socket
Socket
Sign inDemoInstall

@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


Version published
Weekly downloads
162K
decreased by-59.24%
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 12 Jan 2021

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc