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

chaos-sso-login

v0.0.4

Published

前端单点登录

Downloads

5

Readme

chaos-sso-util

介绍

chaos框架对vue框架单点工具

使用说明

安装

cnpm install chaos-sso-login -S

使用(JS或VUE或REACT)

import { setToken, getToken, setUser, getUser, toLogin } from 'chaos-sso-login'

如何上传自己的npm包

第一步

去npm的官方网站注册一个账号点击打开链接

第二步

使用npm init初始化一个package.json文件 注意:必须要有这个文件才能上传,npm可以上传任何一个包含package.json的包, package.json的main(入口)设置为index.js(名字自取)然后在本目录下建一个index.js文件, name表示你这个包的名字只能小写,version代表版本,每次更新都要修改这里的版本再npm publish

package.json可以在这里了解一下点击打开链接

第三步

在本地使用命令行连接npm 使用下面的命令 然后按照提示走,密码默认是不会显示出来的

npm login 或者 npm adduser

第四步

因为大部分的人npm使用的是淘宝镜像,上传会失败,所以需要替换为原来的镜像 https://registry.npmjs.org/

npm config set registry https://registry.npmjs.org/

再查看是否设置成功

npm config get registry

更改了镜像需要按照前面说过的步骤,重新在本地登陆你的npm账户

第五步

上传

npm publish

撤销上传

如果想删除已经上传了的包,可以在package.json所在目录使用以下命令

npm unpublish --force

更新上传后的npm包

  1. 第一种是你可以手动去package.json里面修改版本号,修改后的版本号必须比之前的大,然后使用npm publish上传
  2. 第二种是使用npm 命令行工具更新版本号,再使用npm publish 上传
  3. 版本号由三位组成  a.b.c,切换到package.json所在目录
  • 更新c处:npm version patch
  • 更新b处: npm version minor
  • 跟新a处: npm version major

每使用一次上面的命令,就在版本号对应的地方加一