mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-17 16:49:35 +00:00
Update cheatsheets
This commit is contained in:
38
tldr/npm-diff
Normal file
38
tldr/npm-diff
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# npm diff
|
||||
|
||||
> Compare package versions from the `npm` registry and show differences.
|
||||
> Similar to `git diff`.
|
||||
> More information: <https://docs.npmjs.com/cli/commands/npm-diff>.
|
||||
|
||||
- Compare two specific package versions:
|
||||
|
||||
`npm diff --diff {{package_name}}@{{version1}} --diff {{package_name}}@{{version2}}`
|
||||
|
||||
- Compare current local packages with latest published version:
|
||||
|
||||
`npm diff`
|
||||
|
||||
- Compare current local package with a specific version:
|
||||
|
||||
`npm diff --diff {{package_name}}@{{version}}`
|
||||
|
||||
- Compare a package in the current directory with the registry version:
|
||||
|
||||
`npm diff --diff {{package_name}}`
|
||||
|
||||
- Show only filenames that differ:
|
||||
|
||||
`npm diff --diff-name-only --diff {{package_name}}@{{version1}} --diff {{package_name}}@{{version2}}`
|
||||
|
||||
- Compare specific files or directories only:
|
||||
|
||||
`npm diff {{path/to/file_or_directory}} --diff {{package_name}}@{{version1}} --diff {{package_name}}@{{version2}}`
|
||||
|
||||
- Ignore whitespace when comparing:
|
||||
|
||||
`npm diff --diff-ignore-all-space --diff {{package_name}}@{{version1}} --diff {{package_name}}@{{version2}}`
|
||||
Reference in New Issue
Block a user