Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-diff

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-diff

Returns the git diff of two strings

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

git-diff

Build Status Coverage Status dependencies Status npm npm node

Returns the git diff of two strings


Usage

npm install --save git-diff

git-diff takes 3 arguments, the first string to diff, the second string to diff and optionally a color flag (boolean)

git-diff returns a string containing the difference

The color flag (defaults to false) indicates whether you want the return value to be colorized with chalk

Examples to demonstrate usage follow.

With color:

var gitDiff = require('git-diff')
var actual = gitDiff('a\nb\n', 'a\nc\n', true)
expect(actual).to.equal('a\n-b\n+c\n')

Without color:

var gitDiff = require('git-diff')
var actual = gitDiff('a\nb\n', 'a\nc\n')
expect(actual).to.equal('a\n-b\n+c\n')

Author says

What's the difference between how God treats the righteous and the wicked?

And God saw that the light was good. And God separated the light from the darkness. Genesis 1:4 ESV

And he will do it again:

Let both grow together until the harvest, and at harvest time I will tell the reapers, “Gather the weeds first and bind them in bundles to be burned, but gather the wheat into my barn.” Matthew 13:30 ESV

Much love :D






Keywords

FAQs

Package last updated on 24 Aug 2017

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