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

sw-map

v1.5.1

Published

sw openlayer 业务地图常用功能组件集合

Downloads

9

Readme

初次发布npm记录

  1. repository

    • url 格式就是项目git上的 https完整地址把https换成git

    • 关联并发布npm后,在npm官网的该npm包页面右边会显示有github链接,点击可以跳转到github项目地址。

  2. files

    • 配置要上传npm的文件白名单目录
  3. npm link

    • 开发的模块中直接输入 会在全局创建快捷方式 类似npm install -g xxx
  4. npm link package_name

    • 调试项目链接 连接后再 node_module中能看到
    • node 前端项目都可以 注意导出和导入方式
    • 将全局模块链接至本地 npm install -g moduleName是将模块装到全局目录下,但是全局方式的安装是供命令行(command line)使用的,比如grunt,全局安装的模块是没有办法用require调用包的。因为上面要在项目中requre包,所以必须先npm link一下
  5. "type": "module"

    • node使用 es6 的import export 需在两边库与项目中的package.json 都添加 "type": "module",
    • 仅仅前端测试可不添加
  6. 发布前要确定是npm 官方源而不是镜像源

    • npm config get registry
    • npm config set registry https://registry.npmjs.org
  7. 使用pnpm

    • 使用link是 需要添加--global参数
    • 会在package dependencies中添加 包名和版本
  8. ts添加

    • package.json 中
      • devDependencies添加 typescript 依赖
      • scrip "build": "tsc
      • 修改入口 "main": "dist/index.js",
      • 添加types "types": "dist/index.d.ts", d.ts编译自动生成的
    • tsconfig.json配置
      • 参考vue/core 配置
      • "module": "esnext", 编译生成 es6语法js 为向下兼容更多可以修改为commjs等
  9. 添加jest测试

    • 比较繁琐更具官网文档操作
  10. vitest