$ gnpm install @npmcli/disparity-colors
Spiritual sucessor to disparity. Colorizes Diff Unified format output using ansi-styles.
npm install @npmcli/disparity-colors
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");
`)
// [33m--- a/src/index.js[39m
// [33m+++ b/src/index.js[39m
// [35m@@ -1,4 +1,5 @@[39m
// "use strict";
// [32m+"use foo";[39m
//
// const os = require("os");
colorize(str, opts = {}) -> String
str
: A Diff Unified format stringopts
:
headerLength
: A Number defining how many lines should be colorized as headerA String including the appropriate ANSI escape codes
Copyright 2013 - present © cnpmjs.org | Home |