Gathering detailed insights and metrics for lockfile-lint
Gathering detailed insights and metrics for lockfile-lint
Gathering detailed insights and metrics for lockfile-lint
Gathering detailed insights and metrics for lockfile-lint
lockfile-lint-api
Lint an npm or yarn lockfile to analyze and detect issues
@types/lockfile-lint-api
TypeScript definitions for lockfile-lint-api
package-lock-version
Check and assert the package-lock.json version
@teamteanpm2024/cupiditate-voluptas-perspiciatis
security holding package
Lint an npm or yarn lockfile to analyze and detect security issues
npm install lockfile-lint
Typescript
Module System
Min. Node Version
Node Version
NPM Version
92.2
Supply Chain
98.8
Quality
81.2
Maintenance
100
Vulnerability
99.6
License
lockfile-lint-api@5.9.2
Updated on Apr 27, 2025
lockfile-lint@4.14.1
Updated on Apr 27, 2025
lockfile-lint@4.14.0
Updated on Jun 14, 2024
lockfile-lint@4.13.2
Updated on Feb 21, 2024
lockfile-lint-api@5.9.1
Updated on Feb 11, 2024
lockfile-lint@4.13.1
Updated on Feb 11, 2024
JavaScript (99.69%)
Shell (0.31%)
Total Downloads
22,307,661
Last Day
12,554
Last Week
164,702
Last Month
688,485
Last Year
6,769,980
Apache-2.0 License
798 Stars
283 Commits
36 Forks
9 Watchers
14 Branches
36 Contributors
Updated on May 29, 2025
Latest Version
4.14.1
Package Id
lockfile-lint@4.14.1
Unpacked Size
37.10 kB
Size
10.76 kB
File Count
7
NPM Version
10.8.2
Node Version
18.20.8
Published on
Apr 27, 2025
Cumulative downloads
Total Downloads
Last Day
-10.7%
12,554
Compared to previous day
Last Week
-8%
164,702
Compared to previous week
Last Month
-1.8%
688,485
Compared to previous month
Last Year
54.9%
6,769,980
Compared to previous year
5
19
A CLI to lint a lockfile for security policies
A CLI tool to lint a lockfile for security policies
1npm install --save lockfile-lint
lockfile-lint
can be installed per a project scope, or globally and exposes a lockfile-lint
executable that should be practiced during builds, CIs, and general static code analysis procedures to ensure that lockfiles are kept up to date with pre-defined security and usage policies.
1lockfile-lint --type <yarn|npm> --path <path-to-lockfile> --validate-https --allowed-hosts <host-to-match> --allowed-urls <urls-to-match>
Supported lockfiles:
package-lock.json
and npm-shrinkwrap.json
yarn.lock
An example of running the linter with debug output for a yarn lockfile and asserting that all resources are using the official npm registry as source for packages:
1DEBUG=* lockfile-lint --path yarn.lock --type yarn --allowed-hosts npm
Example 2: specify hostnames and enforce the use of HTTPS as a protocol
1lockfile-lint --path yarn.lock --allowed-hosts registry.yarnpkg.com --validate-https
--type yarn
is ommitted since lockfile-lint can figure it out on it's own--allowed-hosts
explicitly set to match yarn's mirror hostExample 3: allow the lockfile to contain packages served over github and so need to specify github.com as a host as well as the git+https:
as a valid URI scheme
1lockfile-lint --path yarn.lock --allowed-hosts yarn github.com --allowed-schemes "https:" "git+https:"
--allowed-hosts
explicitly set to match github.com as a host and specifies yarn
as the alias for yarn's official mirror host--allowed-schemes
is used instead of validate-https
and it explicitly allows both https:
and git+https:
as the HTTP Scheme for the github URL. Note that --allowed-schemes
and --validate-https
are mutually exclusive.Example 4: allow the lockfile to contain a package which resolves to a specific URL specified by the --allowed-urls
option while all other packages must resolve to yarn as specified by --allowed-hosts
1lockfile-lint --path yarn.lock --allowed-hosts yarn --allowed-urls https://github.com/lirantal/lockfile-lint#d30ce73a3e5977dede29450df1c79b09f02779b2
--allowed-hosts
allows packages from yarn only--allowed-urls
overrides allowed-hosts
and allows a specific Github URL to pass validationcommand line argument | description | implemented |
---|---|---|
--path , -p | path to the lockfile but you can also provide a glob matching pattern as long as it isn't expanded by a shell like bash or zsh. If that's the case, you can provide it as a string, for example: -p '/Users/lirantal/repos/**/package-lock.json' to match multiple lockfiles | ✅ |
--type , -t | lockfile type, options are npm or yarn | ✅ |
--format , -f | sets what type of report output is desired, one of [ pretty , plain ] with plain removing colors & status symbols from output | ✅ |
--validate-https , -s | validates the use of HTTPS as protocol schema for all resources in the lockfile | ✅ |
--allowed-hosts , -a | validates a list of allowed hosts to be used for all resources in the lockfile. Supported short-hands aliases are npm , yarn , and verdaccio which will match URLs https://registry.npmjs.org , https://registry.yarnpkg.com and https://registry.verdaccio.org respectively | ✅ |
--allowed-schemes , -o | allowed URI schemes such as "https:", "http", "git+ssh:", or "git+https:" | ✅ |
--allowed-urls , -u | allowed URLs (e.g. https://github.com/some-org/some-repo#some-hash ) | ✅ |
--empty-hostname , -e | allow empty hostnames, or set to false if you wish for a stricter policy | ✅ |
--validate-package-names , -n | validates that the resolved URL matches the package name | ✅ |
--validate-integrity , -i | validates the integrity field is a sha512 hash | ✅ |
--allowed-package-name-aliases , -l | allow package name aliases to be used by specifying package name and their alias as pairs (e.g: string-width-cjs:string-width ) | ✅ |
--integrity-exclude | exclude packages from the --validate-integrity check | ✅ |
Lockfile-lint uses cosmiconfig for configuration file support. This means you can configure the above options via (in order of precedence):
The configuration file will be resolved starting from the current working directory, and searching up the file tree until a config file is (or isn't) found. Command-line options take precedence over any file-based configuration.
The options accepted in the configuration file are the same as the options above in camelcase (e.g. "path", "allowedHosts").
Please consult CONTRIBUTING for guidelines on contributing to this project.
lockfile-lint © Liran Tal, Released under the Apache-2.0 License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 6
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 5/23 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
35 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-26
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More