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-util

v2.8.9

Published

chaos框架对vue框架单点工具

Downloads

47

Readme

chaos-sso-util

介绍

chaos 框架对 vue 框架单点工具

使用说明

安装

cnpm install chaos-sso-util -S

使用(JS 或 VUE)

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

如何上传自己的 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

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