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

@qcqx/nlm

v2.0.1

Published

npm local modules - 本地 npm 包联调工具

Readme

nlm - npm local modules

本地 npm 包联调工具,足够简单易用,不修改 package.json,不影响 git 流程。仅增加一个 .nlm 目录,且自动加入 .gitignore

Why

在开发多个npm包时,除了在包内维护demo及测试用例外,往往还需要在项目中安装最新的包产物进行联调,以实际查看效果。

npm-link 在有限程度上解决了这个问题,但使用上仍然存在一些约束与问题。

What

  • nlm 在本地模拟发包,将包产物发布到全局 store,具有符合 npm 版本规范的管理方式,在安装时派发产物副本到项目的 .nlm 目录,并在 node_modules 中建立软链接
  • nlm 帮你处理了许多繁琐的工作,只需要 push 你的包,然后 installupdate 即可。
  • 支持 i18n,默认自动识别语言环境,或使用 --lang 选项手动指定。
  • 本质来说,nlm 仅仅只是修改了 node_modules 中某个包的指向,其它一切都不会和包管理器有任何冲突。

Installation

npm i nlm -g

Config

  • 项目级配置文件 <project>/.nlm/nlm.config.json
  • 全局配置文件 ~/.nlm/nlm.config.json
{
  // 指定使用的包管理器,用于需要时安装部分依赖,默认 npm
  "packageManager": "npm"
}

Usage

push

推送包到全局 store,并更新所有使用此包的项目。

nlm push [options]
nlm p

Options:
  -f, --force 强制推送,跳过 hash 检查
  --packlist 强制使用 npm-packlist 获取文件列表,默认使用 tinyglobby 快速方案,特殊情况自动降级

install

安装包到当前项目

如果没有指定包名,则列出所有可安装的包,并交互式选择安装。

nlm install [package] [options]
nlm i

Options:
  -f, --force 强制安装,跳过 hash 检查

同 npm 一样,已经安装过的包,包名未指定版本时,将按 lockfile 中的 lock 版本规则更新。

update

更新包到当前项目

如果没有指定包名,则更新所有已安装的 nlm 包

nlm update [package] [options]
nlm up

Options:
  -f, --force 强制更新,跳过 hash 检查

list

列出项目或全局 store 中的所有包

nlm list [options]
nlm ls

Options:
  -s, --store 列出全局 store 中的所有包

uninstall

在当前项目中卸载

如果没有指定包名,则列出所有已安装的包,并交互式选择卸载。

nlm uninstall [package]
nlm un

config

交互式配置 nlm,自动生成项目或全局配置

nlm config [options]
nlm c

Options:
  -g, --global 配置全局设置 (默认是项目级配置)

search

搜索全局 store 中的包

nlm search <keyword>
nlm s

status

查看当前项目中所有 nlm 包的状态

nlm status
nlm st

Common Options

--debug 开启调试模式,输出详细日志
--lang 设置语言 (zh/en),默认自动推断

构建后自动推送

如果你需要持续构建并自动推送包,且原构建工具不支持指定构建后自动执行命令,可以结合 concurrentlychokidar-cli 实现。

# npm run build:watch 是你的持续构建命令
concurrently "npm run build:watch" "chokidar 'lib/**/*' -d 1000 -c 'echo 构建完成 && nlm push'"
# 监听 lib 目录下的所有文件,当文件变化时自动推送,1000ms 防抖

Compatibility

兼容 node >= 18.17

^14 ^16 版本交互式命令行输入将报错,但不影响核心功能

开发环境 node >= 20

Reference