- IF NO arg:
- READ
package.json
name- IF FOUND:
- RETURN
package-json-name@tag
-file:.
- RETURN
- ELSE:
- THROW usage
- IF FOUND:
- READ
- IF arg is
package-name
only:- READ arborist load actual tree AND PARSE
package-name
- IF NOT SPEC TYPE REGISTRY:
- THROW unsupported spec type
- IF FOUND:
- RETURN
package-name@FOUND_VERSION
- RETURN
- ELSE:
- RETURN
package-name@latest
- RETURN
- IF NOT SPEC TYPE REGISTRY:
- READ arborist load actual tree AND PARSE
- IF arg is validl semver range|version:
- READ
package-name
from either arg1 or arg2- IF FOUND:
- RETURN
other-arg-parsed-name@arg
- RETURN
- ELSE:
- READ
package.json
name- IF FOUND:
- RETURN
package-json-name@arg
- RETURN
- IF NO
package.json
:- THROW error need to run from package dir to user versions
- IF FOUND:
- READ
- IF FOUND:
- READ
- Equivalent to
npm diff file:. $(package.json name)@latest
Note: Default tag name can be configured via --tag
config.
- arg is a known dependency name (ie,
npm diff depname
)- equivalent to
npm diff node_modules/${arg} ${arg}@${wanted version}
- equivalent to
- arg is a known dep name with spec (ie
npm diff depname@version
)- equivalent to
npm diff node_modules/${depname} ${arg}
- equivalent to
- arg is a SemVer range (including single versions) (ie,
npm diff 1.x
)- equivalent to
npm diff ${package.json name}@${arg} file:.
- equivalent to
- arg is a package name not a dependency with spec (ie,
npm diff [email protected]
)- equivalent to
npm diff [email protected] file:.
- equivalent to
- arg is a package name not a dependency with NO SPEC (ie,
npm diff pkg
)- equivalent to
npm diff arg@latest file:.
- equivalent to
-
first arg is a known dependency name
- second arg is a known dependency name
- equivalent to
npm diff ${nm/arg1.name@nm/arg1.version} ${nm/arg2.name@nm/arg2.version}
- equivalent to
- second arg is a known dependency name with spec
- equivalent to
npm diff ${nm/arg1.name@nm/arg1.version} arg2
- equivalent to
- second arg is a SemVer range (including single versions)
- equivalent to
npm diff ${nm/arg1.name@nm/arg1.version} ${nm/arg1.name@arg2}
- equivalent to
- second arg is a package name not a dependency with spec
- equivalent to
npm diff ${nm/arg1.name@nm/arg1.version} arg2
- equivalent to
- second arg is a package name not a dependency NO spec
- equivalent to
npm diff ${nm/arg1.name@nm/arg1.version} ${arg2@latest}
- equivalent to
- second arg is a known dependency name
-
first arg is a known dep name with spec (ie,
depname@tag
)- second arg is a known dependency name
- equivalent to
npm diff arg1 ${nm/arg2}
- equivalent to
- second arg is a known dependency name with spec
- equivalent to
npm diff arg1 arg2
- equivalent to
- second arg is a SemVer range (including single versions)
- equivalent to
npm diff arg1 ${nm/arg1.name}@arg2
- equivalent to
- second arg is a package name not a dependency with spec
- equivalent to
npm diff arg1 arg2
- equivalent to
- second arg is a package name not a dependency NO spec
- equivalent to
npm diff arg1 arg2@latest
- equivalent to
- second arg is a known dependency name
-
first arg is a SemVer range (including single versions)
- second arg is a known dependency name
- equivalent to
npm diff ${nm/arg2.name}@arg1 ${nm/arg2.name@nm/arg2.version}
- equivalent to
- second arg is a known dependency name with spec
- equivalent to
npm diff ${nm/arg2.name}@arg1 arg2
- equivalent to
- second arg is a SemVer range (including single versions)
- equivalent to
npm diff ${package-json-name}@arg1 ${package-json-name}@arg2
- equivalent to
- second arg is a package name not a dependency with spec
- equivalent to
npm diff ${arg2.name}@arg1 arg2
- equivalent to
- second arg is a package name not a dependency NO spec
- equivalent to
npm diff ${arg2}@arg1 arg2@latest
- equivalent to
- second arg is a known dependency name
-
first arg is a package name not a dependency with spec
- second arg is a known dependency name
- equivalent to
npm diff arg1 ${nm/arg2.name@nm/arg2.version}
- equivalent to
- second arg is a known dependency name with spec
- equivalent to
npm diff arg1 arg2
- equivalent to
- second arg is a SemVer range (including single versions)
- equivalent to
npm diff arg1 ${arg1.name}@arg2
- equivalent to
- second arg is a package name not a dependency with spec
- equivalent to
npm diff arg1 arg2
- equivalent to
- second arg is a package name not a dependency NO spec
- equivalent to
npm diff arg1 arg2@latest
- equivalent to
- second arg is a known dependency name
-
first arg is a package name not a dependency NO spec
- second arg is a known dependency name
- equivalent to
npm diff arg1@latest ${nm/arg2.name@nm/arg2.version}
- equivalent to
- second arg is a known dependency name with spec
- equivalent to
npm diff arg1@latest arg2
- equivalent to
- second arg is a SemVer range (including single versions)
- equivalent to
npm diff arg1@latest ${arg1.name}@arg2
- equivalent to
- second arg is a package name not a dependency with spec
- equivalent to
npm diff arg1@latest arg2
- equivalent to
- second arg is a package name not a dependency NO spec
- equivalent to
npm diff arg1@latest arg2@latest
- equivalent to
- second arg is a known dependency name