npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-lockfile

v1.0.0

Published

An eslint plugin to lint your npm ecosystem lockfiles.

Readme

eslint-plugin-lockfile Version Badge

github actions coverage License Downloads

npm badge

An ESLint plugin to lint your npm ecosystem lockfiles for security and consistency issues.

This plugin supports lockfiles from npm, yarn, pnpm, bun, and vlt package managers.

Installation

npm install eslint-plugin-lockfile --save-dev

Configuration

Flat Config (ESLint 9+)

// eslint.config.js
import lockfile from 'eslint-plugin-lockfile';

export default [
	lockfile.configs.recommended,
];

Legacy Config (ESLint 8)

{
	"extends": ["plugin:lockfile/recommended-legacy"]
}

Manual Configuration

// eslint.config.js
import lockfile from 'eslint-plugin-lockfile';

export default [
	{
		files: ['**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml', '**/bun.lock', '**/bun.lockb', '**/vlt-lock.json'],
		plugins: { lockfile },
		rules: {
			'lockfile/flavor': ['error', 'npm'],
			'lockfile/version': 'error',
			'lockfile/integrity': 'error',
			'lockfile/registry': 'error',
			'lockfile/non-registry-specifiers': 'error',
			'lockfile/binary-conflicts': 'error',
		},
	},
];

Supported Package Managers

| Package Manager | Lockfile(s) | |-----------------|-------------| | npm | package-lock.json, npm-shrinkwrap.json | | yarn | yarn.lock | | pnpm | pnpm-lock.yaml | | bun | bun.lock, bun.lockb | | vlt | vlt-lock.json |

Rules

| Name | Description | | :--- | :---------- | | binary-conflicts | Detect binary name conflicts between packages | | flavor | Enforce allowed lockfile formats | | integrity | Enforce integrity values in lockfiles | | non-registry-specifiers | Warn on dependencies from non-registry sources | | registry | Enforce allowed registries in lockfiles | | version | Enforce lockfile version |

lockfile/flavor

Enforces which lockfile formats are allowed in your project. This helps ensure your team uses a consistent package manager.

// Allow only npm lockfiles
'lockfile/flavor': ['error', 'npm']

// Allow npm or yarn
'lockfile/flavor': ['error', ['npm', 'yarn']]

// Allow specific lockfile variants
'lockfile/flavor': ['error', [{ name: 'npm', files: ['package-lock.json'] }]]

lockfile/version

Enforces lockfile versions to ensure consistency across environments.

// Default: latest versions for each package manager
'lockfile/version': 'error'

// Specific versions
'lockfile/version': ['error', { npm: 3, yarn: 2, pnpm: '9.0' }]

Valid versions:

  • npm: 1, 2, 3
  • yarn: 1, 2
  • pnpm: '5.3', '5.4', '6.0', '6.1', '7.0', '9.0'
  • bun: 0, 1
  • vlt: 0

lockfile/integrity

Ensures all packages have integrity hashes and verifies they match the actual package tarballs. This protects against supply chain attacks.

// Default: allow all standard algorithms
'lockfile/integrity': 'error'

// Require specific algorithms
'lockfile/integrity': ['error', ['sha512', 'sha384']]

lockfile/registry

Enforces that all packages come from allowed registries. Useful for security policies and private registry enforcement.

// Default: uses npm config registry
'lockfile/registry': 'error'

// Single registry
'lockfile/registry': ['error', 'https://registry.npmjs.org']

// Multiple registries
'lockfile/registry': ['error', ['https://registry.npmjs.org', 'https://npm.pkg.github.com']]

// Per-package registry mapping
'lockfile/registry': ['error', {
	'https://registry.npmjs.org': true,  // Default for all packages
	'https://npm.pkg.github.com': ['@myorg/*'],  // Specific packages
}]

lockfile/non-registry-specifiers

Warns when packages are installed from non-registry sources like GitHub URLs, git URLs, or local file paths. These can bypass integrity checks.

// Warn on all non-registry specifiers
'lockfile/non-registry-specifiers': 'error'

// Ignore specific specifiers with explanation
'lockfile/non-registry-specifiers': ['error', {
	ignore: [
		{
			specifier: 'github:user/repo#commit',
			explanation: 'Required for unreleased bug fix',
		},
	],
}]

lockfile/binary-conflicts

Detects when multiple packages provide command-line binaries with the same name, which can cause non-deterministic behavior.

'lockfile/binary-conflicts': 'error'

CLI

For a standalone CLI that doesn't require ESLint configuration, see lintlock.

Tests

Clone the repo, npm install, and run npm test.

License

MIT