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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iscdev/messenger

v1.0.17

Published

> TODO: description

Readme

messenger

指令集信使工具包
包含了SSO和ACL,还有一些和基座通信的功能(暂未开放)

安装

npm i -S @iscdev/messenger

sso

单点登录

使用

import {sso} from '@iscdev/messenger'

sso.auth(options?: AuthOptions) 授权验证

该方法尽量靠前调用,调用后如果本地存储中没有授权信息则会跳转至指令集的授权登录页,登录成功后会携带token跳回当前页面

options传入一个对象,字段如下:

  • excludes: 一个数组,用以验证白名单,匹配当前路径的pathname部分,可以为字符串(全文匹配),可以为正则表达式,也可以为方法( 返回匹配结果),例如:['foo/bar', (p)=>p.startsWith('foo/'), /^foo\//]

access

权限控制

使用

import {access} from '@iscdev/messenger'

初始化

使用前需要初始化:access.init(appCode: string, options?:InitAccessOptions)

  • appCode: 为注册在系统中的App的appCode,可以从系统管理中获取
  • options: 为初始化选项
    • router: vue-router的路由实例,用以监控路由是否可访问,如果不可访问,则会跳转到默认的无权限页面或者所传入的后补路由
    • fallbackRoute: 后补路由

判断是否有权限

function access(accessCode: string | string[]) 传入一个权限码,需要在权限管理应用中配置获取

  • accessCode 支持多个code传入,数组表示逻辑或,以逗号分隔字符串表示逻辑与,以!开头的字符串表示逻辑取反,且支持组合

返回值为Boolean,为是否有权限

将权限应用到路由实例

function accessToRouter(router: Router, fallbackRoute?: RouteLocationRaw)
同初始化中的配置,该方法为手动应用

将权限使用到vue的插件和指令中

import {useVueAccess} from '@iscdev/messenger'

useVueAccess(app)   //vue的App实例

支持两种个使用方式,具体使用哪种取决于具体的业务场景,如下:

  1. <div v-access="app/edit">编辑</div>,直接使用v-access指令
  2. <div v-if="$access('app/edit')">编辑</div>,使用全局的$access方法