Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
/ node-ansidiff Public archive

a small node.js library for ANSI colored text diffs

Notifications You must be signed in to change notification settings

trentm/node-ansidiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansidiff -- a small node.js library for ANSI colored text diffs

Usage

var ansidiff = require('ansidiff');
var log = console.log;
log( ansidiff.chars('will work for food', 'will code for foo') );
log( ansidiff.words('will work for food', 'will code for foo') );
log( ansidiff.lines('one\ntwo\nthree', 'one\ndeux\ntrois\nthree') );
log( ansidiff.css('#body { color: blue }', '.content { color: blue }') );

These are using the default bright colorer. You can use the subtle one if you wish:

log( ansidiff.words('will work for food', 'will code for foo', ansidiff.subtle) );

In my terminal that looks like this:


ansi color diffs


Install

npm install ansidiff

License

MIT.

About

a small node.js library for ANSI colored text diffs

Resources

Stars

Watchers

Forks

Packages

No packages published