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

@laiye_packages/uci

v1.1.4

Published

A comprehensive utility library for frontend applications with HTTP client, storage, i18n, crypto, logger, and OpenTelemetry support

Downloads

1,084

Readme

UCI - 统一客户端基础设施

UCI 提供企业级应用核心功能:应用管理、认证、API、国际化、权限、加解密。

主要导出

// 应用管理
import { LYBaseApp, LYOrganizationApp, ORGANIZATION_APP_NAME } from '@monorepo/uci';

// 会话
import { LYSession } from '@monorepo/uci';

// 加解密
import { crypto } from '@monorepo/uci';

// 类型
import type { LYUserResponse, LYRoleItem, LYListResponse } from '@monorepo/uci';

核心用法

获取 App 实例

// 获取你自己的 app(组件外使用)
const app = LYBaseApp.get('apa');

// 获取内置的 organization app
const orgApp = LYBaseApp.get<LYOrganizationApp>(ORGANIZATION_APP_NAME);

获取用户信息

const session = LYSession.get();
console.log(session?.user_id, session?.display_name);

调用 API

// 使用你的 app 的 httpClient
const httpClient = LYBaseApp.get('apa').httpClient;
const response = await httpClient.post('/api/endpoint', data);

// 使用 organization app 的 API
const orgApp = LYBaseApp.get<LYOrganizationApp>(ORGANIZATION_APP_NAME);
const users = await orgApp.userApi.query({ offset: 0, size: 20 });
const roles = await orgApp.permissionApi.getRoles({ offset: 0, size: 20 });
const layout = await orgApp.getLayout();

退出登录

const orgApp = LYBaseApp.get<LYOrganizationApp>(ORGANIZATION_APP_NAME);
orgApp.getAuthorizer().signout({ redirect_uri: window.location.href });

检查权限

const session = LYSession.get();
const permission = session?.permissions?.['organization'];
if (permission?.codes.includes('user_manage')) { /* 有权限 */ }

加解密(国密算法)

// 通过 app 实例获取 crypto
const app = LYBaseApp.get('yourAppName');

// 哈希(SM3)
const hash = app.crypto.hash('数据', '可选密钥', 1);

// 对称加密/解密(SM4)
const encrypted = app.crypto.encryptSymmetric('敏感数据', 'iv', 'key');
const decrypted = app.crypto.decryptSymmetric(encrypted, 'iv', 'key');

// 非对称加密/解密(SM2)
const asymEncrypted = app.crypto.encryptAsymmetric('数据', '公钥');
const asymDecrypted = app.crypto.decryptAsymmetric(asymEncrypted, '私钥');

// 签名/验证
const signature = app.crypto.signature('数据', '私钥');
const isValid = app.crypto.verify('数据', signature, '公钥');

详细使用指南请查看 PROJECT_GUIDE.md