
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
@qlover/fe-corekit
Advanced tools
fe-corekit (@qlover/fe-corekit) 是一个功能全面的前端核心工具包,提供了多种实用工具和模块,帮助开发者更高效地构建前端应用。它包含了存储管理、序列化、网络请求、日志记录、任务执行等多个核心功能模块。
使用 npm、yarn 或 pnpm 安装:
# npm
npm install @qlover/fe-corekit
# yarn
yarn add @qlover/fe-corekit
# pnpm
pnpm add @qlover/fe-corekit
fe-corekit 支持多种导入方式,可以根据需要导入整个库或特定模块:
import * as CoreKit from '@qlover/fe-corekit';
const logger = new CoreKit.Logger();
logger.info('Hello, world!');
// 导入日志模块
import { Logger } from '@qlover/fe-corekit';
const logger = new Logger();
logger.info('Hello, world!');
// 导入存储模块
import { JSONStorage } from '@qlover/fe-corekit';
const storage = new JSONStorage();
storage.setItem('key', { data: 'value' });
// 创建内存存储
const storage = new JSONStorage();
storage.setItem('key', { data: 'value' }, 3600); // 设置过期时间为3600毫秒
const value = storage.getItem('key');
// => { data: 'value' }
// 使用浏览器的 localStorage
const storage = new JSONStorage(localStorage);
storage.setItem('key', { data: 'value' });
const value = storage.getItem('key');
// => { data: 'value' }
// 使用自定义序列化器和存储后端
const customSerializer = {
serialize: JSON.stringify,
deserialize: JSON.parse
};
const customStorage = {
setItem: (key: string, value: string) => {
localStorage.setItem(key, value);
},
getItem: (key: string) => {
return localStorage.getItem(key);
},
removeItem: (key: string) => {
localStorage.removeItem(key);
},
clear: () => {
localStorage.clear();
}
};
const storage = new JSONStorage(customStorage, customSerializer);
storage.setItem('key', { data: 'value' });
const logger = new Logger();
logger.info('应用启动');
logger.warn('警告信息');
logger.error('错误信息');
fe-corekit 完全使用 TypeScript 编写,提供了完整的类型定义,可以获得良好的 IDE 提示和类型检查。
fe-corekit 支持所有现代浏览器和 Node.js 环境。支持 ES 模块和 CommonJS 两种模块系统。
当前版本: 1.2.0
有关更新和变更的详细信息,请查看更新日志。
FAQs
A corekit for frontwork
We found that @qlover/fe-corekit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.