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

@yakj/y407

v0.0.21

Published

```typescript // 在vue中 this.$store.state.Auth.Rule // 在ts中 store.state.Auth.Rule ``` ### 判断权限 ```typescript // Rule.Cur标识当前企业 /** * 权限对象 */ export default class URule { /** * 用户UID */ UID: number = 0 /** * 企业编号 */ GID: number = 0

Readme

权限说明

1、读取用户权限

// 在vue中 
this.$store.state.Auth.Rule
// 在ts中
store.state.Auth.Rule

判断权限

// Rule.Cur标识当前企业
/**
 * 权限对象
 */
export default class URule {
  /**
   * 用户UID
   */
  UID: number = 0
  /**
   * 企业编号
   */
  GID: number = 0
  /**
   * 根企业,即EID=159
   */
  Root = new Admin()
  /**
   * 是否系统管理员
   */
  System: number = 0
  /**
   * 当前企业岗位信息
   */
  Posts: any[] = []
  /**
   * 当前企业组织结构
   */
  Orgs: any[] = []
  /**
   * 服务商标志
   */
  Service = new Admin()
  /**
   * 政府标志
   */
  Gov = new Admin()
  /**
   * 是否是游客,即未加入任何企业
   */
  Tourist = 0
  /**
   * 当前企业权限标志
   */
  Cur = new Admin()
  /**
   * 可切换的企业编号列表
   */
  GIDs: number[] = []
}
/**
 * 管理权限标志
 */
export class Admin {
  /**
   * 管理员标志
   * 1 企业管理员
   * 2 企业部门管理员
   * 3 企业岗位管理员
   */
  Admin = 0
  /**
   * 成员标志
   * 1 成员
   * 0 不是成员
   */
  Member = 0
}

if(rule.Root.Admin){
    //表示时易安空间的管理员,即最高管理权限
}else if(rule.Root.Member){
    //表示时易安空间的工作人员,低于最高管理权限
}else if(rule.Cur.Admin==1){
    //表示时当前企业的最高管理员
}else if(rule.Cur.Admin ==2){
    //表示是当前企业的二级管理员
}else if(rule.Cur.Member){
    //表示是当前企业的成员
}else {
    //表示在当前企业中是游客
}

2、读取当前企业信息

// 在vue中 
this.$store.state.Auth.Enter
// 在ts中
store.state.Auth.Enter


// Enter.Type类型标识为EnterpriseType的枚举值,其他参数同Enterprise对象
export enum EnterpriseType {
    '企业' = 1,
    '服务商' = 2,
    '社区' = 4,
    '政府' = 5
}

3、读取某个企业的信息

get_enterprise_info(EIDs:number[]):Promise<EnterpriseClass>
// 请不要再使用EnterpriseApi.search接口了

4、读取管理的成员列表

get_managed_uids()

5、读取岗位的成员列表

get_posts_members(岗位数组)