Socket
Socket
Sign inDemoInstall

ansidiff

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansidiff

ANSI colored text diffs


Version published
Weekly downloads
952
decreased by-7.66%
Maintainers
1
Weekly downloads
 
Created
Source

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.

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 }') );

Keywords

FAQs

Package last updated on 13 Mar 2012

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