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

nick-mobile

v0.0.1

Published

a Vue 2.x UI Framework

Downloads

3

Readme

nick-mobile

安装

使用本框架前,请在 CSS 中开启 border-box

*{box-sizing: border-box}

不能直接指定组件的样式,比如g-button, 不能写g-button {xxx},因为g-button类似于一个占位符,最终渲染的是组件包裹中的内容。

持续集成

包括:

  • 持续测试
  • 持续交付
  • 持续部署

上传代码到 npmjs.org

  • 更新 package.json
    • 在 package.json 里将版本号改为 0.0.1,等我们做完了再改成 1.0.0
    • 创建 index.js,在 index.js 里将你想要导出的内容全部导出
    • 在 package.json 中添加 "main": "index.js"作为打包的入口文件
  • 去 https://www.npmjs.com/ 注册一个账户
  • 确认一下邮箱(必须)
  • 在项目根目录运行 npm adduser
    • 如果错误提示里面含有 https://registry.npm.taobao.org 则说明你的 npm 源目前为淘宝源,需要更换为 npm 官方源 运行 npm publish

使用自己的包

  1. 预测其他使用你的包的人会怎么使用
  • 使用 vue-cli
  • 使用 webpack
  • 使用 parcel
  1. 分别使用这些方式来使用自己的包(我们只以 vue-cli 为例)
  • 使用过程中我们发现报错说 import 语法有问题,那时因为 node 目前确实不支持 import,我们需要用 babel 转译 import
    • 你可以要求使用者自己用 babel 来转译
    • 你也可以转义好了再给他用
      • npx parcel build index.js --no-minify (本来不应该加 --no-minify 的,奈何不加会有 bug,HTML 压缩把 slot 标签全删了)
      • 将 package.json 的 main 改为 dist/index.js
  1. 使用 npm link 或者 yarn link 来加速调试(因为每次修改一点代码,我们就需要npm publish,然后重新在项目中npm install来测试修改是否生效,非常麻烦)
    • 你每次修改源码之后,有两条路让别人得到最新效果
      • 更新 package.json 里的 version,然后 npm publish。别人通过 npm update xxx 来更新。
      • 如果你只是为了本地调试,可以在项目目录使用 npm link,然后在使用之处运行 npm link xxx,就是最新了