The registry diff
npm install libnpmdiff


The registry diff lib.
* Example
* Install
* Contributing
* API
* LICENSE
``js
const libdiff = require('libnpmdiff')
const patch = await libdiff([
'abbrev@1.1.0',
'abbrev@1.1.1'
])
console.log(
patch
)
`
Returns:
`patch
diff --git a/package.json b/package.json
index v1.1.0..v1.1.1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "abbrev",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "Like ruby's abbrev module, but in js",
"author": "Isaac Z. Schlueter ",
"main": "abbrev.js",
`
$ npm install libnpmdiff
The npm team enthusiastically welcomes contributions and project participation!
There's a bunch of things you can do if you want to contribute!
The Contributor Guide outlines the process for community interaction and contribution.
Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
All participants and maintainers in this project are expected to follow the npm Code of Conduct, and just generally be excellent to each other.
Please refer to the Changelog for project history details, too.
Happy hacking!
#### > libnpmdif([ a, b ], [opts]) -> Promise
Fetches the registry tarballs and compare files between a spec a and spec b.
npm spec types are usually described in form but multiple other types are also supported, for more info on valid specs take a look at npm-package-arg.
Options:
- color : Should add ANSI colors to string output?false
Defaults to .tagVersionPrefix
- : What prefix should be used to define version numbers.v
Defaults to diffUnified
- : How many lines of code to print before/after each diff.3
Defaults to .diffFiles
- : If set only prints patches for the files listed in this array (also accepts globs).undefined
Defaults to .diffIgnoreAllSpace
- : Whether or not should ignore changes in whitespace (very useful to avoid indentation changes extra diff lines).false
Defaults to .diffNameOnly
- : Prints only file names and no patch diffs.false
Defaults to .diffNoPrefix
- : If true then skips printing any prefixes in filenames.false
Defaults to .diffSrcPrefix
- : Prefix to be used in the filenames from a.a/
Defaults to .diffDstPrefix
- : Prefix to be used in the filenames from b.b/
Defaults to .diffText
- : Should treat all files as text and try to print diff for binary files.false
Defaults to .cache
- ..., registry, where and other common options accepted by pacote
Returns a Promise that fulfills with a String containing the resulting patch diffs.
Throws an error if either a or b` are missing or if trying to diff more than two specs.