@npmcli/disparity-colors
Colorizes unified diff output
Last updated 2 years ago by lukekarrys .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install @npmcli/disparity-colors 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 3.0.0                                ...           latest (2 years ago)

4 Versions

  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |