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

cc1-admin-api

v2.0.1

Published

我来助你-后台管理系统-后端接口

Readme

cc1-admin-api 2.0

NestJS RBAC 后端,默认使用 MongoDB,也可通过 SqlConnection 使用 SQLite、MySQL 等单数据库适配器。

启动配置

module.exports = {
  db: 'mongodb',
  sqlUrl: 'mongodb://testmongo:testmongo@localhost:27017/testmongo?authSource=testmongo&replicaSet=rs0',
  maxReconnectAttempts: 10
}

非 MongoDB 模式必须传入 SqlConnection。仓库的 db/connection 提供 SQLite 与 MySQL 实现。

RBAC 变更使用数据库事务;MongoDB 生产部署必须使用支持事务的副本集或分片集群。

RBAC 2.0

  • Auth() 使用当前规范化 URL 授权。
  • AuthOnly() 只校验登录。
  • AuthPermission(url) 复用一个已声明 URL。
  • SuperAdminOnly() 只允许受保护系统角色。
  • 启动会同步 auth_permission;重复 URL、无效别名或同 URL 多 Method 会阻止监听端口。
  • 会话通过自定义 Token 请求头传输,默认有效期 8 小时。

首次启动会创建 ac / 123456,使用 Argon2id 哈希并强制首次改密。生产环境必须在服务对外开放前完成改密。

2.0.0 不读取旧 RBAC 数据。升级前备份数据库,然后删除并重新初始化全部 RBAC 集合。