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

@proteus-vue/security

v0.1.0

Published

Proteus 安全基线(security-plan B1-B2):M1 SecretStorage 敏感字段加密存储(WebCrypto AES-GCM+PBKDF2 / DemoCipher 降级)+ M3 PermissionRegistry 权限最小化

Readme

@proteus-vue/security

Proteus 三端统一安全基线(security-plan B1-B2)。

M1 — SecretStorage(敏感字段加密存储)

import { SecretStorage, createCipher } from '@proteus-vue/security'

// 字段描述符:volatile = 内存 only;encrypted = 加密落盘;默认明文
const fields = {
  token: { value: '', volatile: true },    // 不持久化
  profile: { value: {}, encrypted: true }, // 加密落盘
  settings: { value: {} },                 // 明文落盘
}
const cipher = await createCipher('用户口令/密钥') // 有 WebCrypto → AES-GCM+PBKDF2;无 → DemoCipher(演示级,警告)
const store = new SecretStorage({ storage: localStorageAdapter, fields, cipher })

await store.setItem('user', { token: 'x', profile: { name: 'P' }, settings: { theme: 'dark' } })
const state = await store.getItem('user')   // token 跳过、profile 解密还原
const safe = store.redact(state)            // profile → '***'
await store.migrate('user')                 // 旧明文 → 加密写回(失败清除不崩溃)

M3 — PermissionRegistry(权限最小化)

import { PermissionRegistry, withPermission, permissionFor, PermissionDenied } from '@proteus-vue/security'

const registry = new PermissionRegistry({ storage: localStorageAdapter })
registry.grant([permissionFor('camera', 'use')])

try {
  await withPermission(registry, ['camera:use'], async () => capture()) // 缺权限 → PermissionDenied
} catch (e) {
  if (e instanceof PermissionDenied) showGuide(e.permission)
}

边界(落地评估 v2)

  • DemoCipher 为无 WebCrypto 平台(小程序)的演示级降级——生产接 Keystore/服务端加密(v0.6+)
  • Router 权限守卫自动生成 / <PermissionGate> 组件 / 编译期字段校验 → 后续批次
  • M2 凭证托管(createAuth)在 @proteus-vue/api(贴近请求层),见 docs/proteus-security-plan/06-landing-evaluation.md