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

lockfile-sync-check

v0.0.6

Published

A command-line tool to check if your package manager's lockfile is in sync with the latest changes in your Git repository

Readme

lockfile-sync-check

一个命令行工具,用于检查你的包管理器的锁文件是否与 Git 仓库中的最新更改同步。

特性

  • 支持多种包管理器(npm、yarn、pnpm)
  • 可选的自动依赖安装
  • 易于与 Git 钩子集成

安装

npm install -D lockfile-sync-check
# 或
yarn add -D lockfile-sync-check
# 或
pnpm add -D lockfile-sync-check

使用方法

lockfile-sync-check [包管理器] [--install]

选项

  • 包管理器:可选。指定要使用的包管理器("npm"、"yarn"或"pnpm")。如果不提供,默认 pnpm
  • --install:可选。如果锁文件不同步,自动安装依赖。

示例

# 使用自动检测的包管理器检查锁文件是否同步
lockfile-sync-check

# 使用指定的包管理器检查
lockfile-sync-check pnpm

# 检查并在不同步时自动安装
lockfile-sync-check --install

Git 钩子集成

你可以使用以下两种流行的 Git 钩子管理工具来集成 lockfile-sync-check:

使用 simple-git-hooks

  1. 安装依赖:
npm install -D simple-git-hooks
# 或
yarn add -D simple-git-hooks
# 或
pnpm add -D simple-git-hooks
  1. package.json 中添加配置:
{
  "simple-git-hooks": {
    "post-merge": "lockfile-sync-check --install",
    "post-rewrite": "lockfile-sync-check --install"
  }
}

使用 Husky

  1. 安装依赖:
npm install -D husky
# 或
yarn add -D husky
# 或
pnpm add -D husky
  1. 启用 Git 钩子:
npx husky install
  1. 添加 post-merge 钩子:
npx husky add .husky/post-merge "lockfile-sync-check --install"
npx husky add .husky/post-rewrite "lockfile-sync-check --install"
  1. package.json 中添加 prepare 脚本:
{
  "scripts": {
    "prepare": "husky install"
  }
}

这样,每当你执行 git pull、git merge 或 git rebase 操作时,lockfile-sync-check 都会自动运行并确保你的依赖是最新的。