NPM-DIFF(1) | NPM-DIFF(1) |
npm-diff - The registry diff command
npm diff [...<paths>] npm diff --diff=<pkg-name> [...<paths>] npm diff --diff=<version-a> [--diff=<version-b>] [...<paths>] npm diff --diff=<spec-a> [--diff=<spec-b>] [...<paths>] npm diff [--diff-ignore-all-space] [--diff-name-only] [...<paths>]
Similar to its git diff counterpart, this command will print diff patches of files for packages published to the npm registry.
npm diff --diff=abbrev@1.1.0 --diff=abbrev@1.1.1
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 <i@izs.me>",
"main": "abbrev.js",
npm diff --diff=https://github.com/npm/libnpmdiff --diff=./local-path
npm diff --diff=abbrev
npm diff --diff=pkg@2.0.0
npm diff --diff=1.0.0 --diff=1.1.0
Note that tag names are not valid --diff argument values, if you wish to compare to a published tag, you must use the pkg@tagname syntax.
It's possible to also specify positional arguments using file names or globs pattern matching in order to limit the result of diff patches to only a subset of files for a given package, e.g:
npm diff --diff=pkg@2 ./lib/ CHANGELOG.md
In the example above the diff output is only going to print contents of files located within the folder ./lib/ and changed lines of code within the CHANGELOG.md file.
Defines npm package specifiers to compare using the npm diff command.
This can be specified up to 2 times.
When set to true running npm diff only returns the names of the files that have any difference.
The number of lines of context to print in the unified diff format output.
Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.
Do not show any source or destination prefix.
Show the given source prefix in diff patches headers instead of using "a/".
Show the given source prefix in diff patches headers instead of using "b/".
Treat all files as text.
Uses packages from the global space as a source for comparison.
The tag used to fetch the tarball that will be compared with the local file system files when running npm diff with no arguments.
undefined NaN |