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 🙏

© 2025 – Pkg Stats / Ryan Hefner

public-security

v1.0.1

Published

公共安全

Readme

1.环境变量Path : 指向nodejs的安装目录 2.NODE_PATH : 模块复用,用来寻找模块所提供的路径注册环境变量 3.系统根目录下的.npmrc文件是用于指定npm仓库等信息 4.nodejs安装目录下D:\Developments\nodejs\node_modules\npm.npmrc 中指定包下载后存放的路劲 5.node包加载机制: 项目根目录的node_modules-->NODE_PATH指定的路劲

npm 作用: 1.从npm服务器下载第三方包到本地; 2.从NPM服务器下载并安装别人编写的命令行程序到本地使用; 3.上传本地的包或命令行程序;

1.npm升级: sudo npm install npm -g 2.npm安装模块: 全局安装与本地安装 npm 的包安装分为本地安装(local)、全局安装(global)两种,从敲的命令行来看,差别只是有没有-g而已,比如 npm install express # 本地安装 npm install express -g # 全局安装 如果出现以下错误: npm err! Error: connect ECONNREFUSED 127.0.0.1:8087 解决办法为: $ npm config set proxy null 3.查看全局已经安装的模块 npm ls -g

4.查看配置信息 npm config ls

5.卸载模块 我们可以使用以下命令来卸载 Node.js 模块。 $ npm uninstall express 卸载后,你可以到 /node_modules/ 目录下查看包是否还存在,或者使用以下命令查看: $ npm ls

6.更新模块 我们可以使用以下命令更新模块: $ npm update express

7.搜索模块 使用以下来搜索模块: $ npm search express 8.创建模块 使用命令 : $ npm init 在项目根目录下生成package.json文件

9.在 npm 资源库中注册用户 $ npm adduser

10.发布模块 $ npm publish

{ "name": "express", //包名 "description": "",//包的描述 "version": "4.13.3", //包的版本号 "author": {//包的作者和姓名 "name": "TJ Holowaychuk", "email": "[email protected]" }, "contributors": [ //包的其他贡献者姓名 { "name": "Aaron Heckmann", "email": "[email protected]" }, { ...... } ], "license": "MIT", "repository": { //包代码存放的位置 "type": "git", "url": "git+https://github.com/strongloop/express.git" }, "main" : "包的模块ID", "homepage": "http://expressjs.com/", "keywords": [//关键字 "express", "framework", "sinatra", "web", "rest", "restful", "router", "app", "api" ], "dependencies": { //项目依赖的包列表 "accepts": "~1.2.12", "array-flatten": "1.1.1", "content-disposition": "0.5.0", "content-type": "~1.0.1", "cookie": "0.1.3", "cookie-signature": "1.0.6", "debug": "~2.2.0", "depd": "~1.0.1", "escape-html": "1.0.2", "etag": "~1.7.0", "finalhandler": "0.4.0", "fresh": "0.3.0", "merge-descriptors": "1.0.0", "methods": "~1.1.1", "on-finished": "~2.3.0", "parseurl": "~1.3.0", "path-to-regexp": "0.1.7", "proxy-addr": "~1.0.8", "qs": "4.0.0", "range-parser": "~1.0.2", "send": "0.13.0", "serve-static": "~1.10.0", "type-is": "~1.6.6", "utils-merge": "1.0.0", "vary": "~1.0.1" }, "devDependencies": { "after": "0.8.1", "ejs": "2.3.3", "istanbul": "0.3.17", "marked": "0.3.5", "mocha": "2.2.5", "should": "7.0.2", "supertest": "1.0.1", "body-parser": "~1.13.3", "connect-redis": "~2.4.1", "cookie-parser": "~1.3.5", "cookie-session": "~1.2.0", "express-session": "~1.11.3", "jade": "~1.11.0", "method-override": "~2.3.5", "morgan": "~1.6.1", "multiparty": "~4.1.2", "vhost": "~3.0.1" }, "engines": { "node": ">= 0.10.0" }, "files": [ "LICENSE", "History.md", "Readme.md", "index.js", "lib/" ], "scripts": { "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" }, "gitHead": "ef7ad681b245fba023843ce94f6bcb8e275bbb8e", "bugs": { "url": "https://github.com/strongloop/express/issues" }, "_id": "[email protected]", "_shasum": "ddb2f1fb4502bf33598d2b032b037960ca6c80a3", "_from": "express@*", "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "[email protected]" }, "maintainers": [ { "name": "tjholowaychuk", "email": "[email protected]" }, { "name": "jongleberry", "email": "[email protected]" }, { "name": "dougwilson", "email": "[email protected]" }, { "name": "rfeng", "email": "[email protected]" }, { "name": "aredridel", "email": "[email protected]" }, { "name": "strongloop", "email": "[email protected]" }, { "name": "defunctzombie", "email": "[email protected]" } ], "dist": { "shasum": "ddb2f1fb4502bf33598d2b032b037960ca6c80a3", "tarball": "http://registry.npmjs.org/express/-/express-4.13.3.tgz" }, "directories": {}, "_resolved": "https://registry.npmjs.org/express/-/express-4.13.3.tgz", "readme": "ERROR: No README data found!" }

npm 发布包流程: 1.创建好npm 项目 2.注册账号 3.特别注意:修改本地.npmrc 文件为:npm config set registry=http://registry.npmjs.org 4.登陆用户: npm login 输入用户名,密码,邮箱等信息 5.发布项目:1.如果是在根目录,npm publish <项目路劲> 2.或者:进入项目根目录:npm publish

注意事项: 如果报403,就是没有权限,修改registry=http://registry.npmjs.org或者是该项目已经有人发布过了,应当修改package.json中的name