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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-npm-practice

v1.0.3

Published

### npm 发包注意事项

Downloads

3

Readme

NPM 使用 node 开发一个简单的 npm 包的练习

npm 发包注意事项

1:package.json 中指定 main 具体路径 这路径是在安装我们的发布包的时候 require 我们的包时 自动会找到 main 中对应的文件 2:在发布前先 yarn link 下 然后在别的项目中链接测试 如我们的包名是 test 即 package.json 中的 name 为 test 注意 不是文件夹名称 3:在别的项目文件中 如 demo 文件下 我们链接全局 yarn link test 4:在当前项目中 requre('test') 并测试 5:测试通过后 我们回到 test 下 并发布 npm publish --registry https://registy.yarnpkg.com

注意事项

在我们发布包的时候 一定要注意发布到 npm 官网上 而不是淘宝镜像 因此 如果本地设置了淘宝镜像 我们需要设置为 npm 官网或者使用缀参的形式 即( npm publish --registry https://registy.yarnpkg.com)因为npm淘宝镜像只是一个可读的 只有 npm 官网才是可读可写的

发包后 立即安装我们的 npm 包可能出现的问题

在我们发布了 npm 包的时候 因为是发布到 npm 官方中 如果我们下载 npm 包在淘宝镜像上下载 因为 npm 同步到淘宝镜像上有个时间差的问题 如果我们发布了 npm 包马上就按照 npm 包 可能会存在安装的是以前的老版本或者根本就找到不到这种包的情况 这个时候 我们需要到 npm.taobao.org 找到对应的包 然后点击 SYNC 让他从 npm 官方同步过来

具体可参考根目录附图 xxx.jpg