{"id":21148772,"url":"https://github.com/2ue/local-storage-js","last_synced_at":"2025-10-25T13:36:15.085Z","repository":{"id":143886778,"uuid":"86679467","full_name":"2ue/local-storage-js","owner":"2ue","description":"对localstorage封装一些简单的API，方便调用","archived":false,"fork":false,"pushed_at":"2017-12-19T02:09:13.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T14:47:57.879Z","etag":null,"topics":["h5","html5","javascript","localstorage","storage","store"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2ue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-30T08:39:17.000Z","updated_at":"2017-12-18T09:01:25.000Z","dependencies_parsed_at":"2023-07-04T02:56:36.855Z","dependency_job_id":null,"html_url":"https://github.com/2ue/local-storage-js","commit_stats":null,"previous_names":["2ue/storejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2ue%2Flocal-storage-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2ue%2Flocal-storage-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2ue%2Flocal-storage-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2ue%2Flocal-storage-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2ue","download_url":"https://codeload.github.com/2ue/local-storage-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243589333,"owners_count":20315471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["h5","html5","javascript","localstorage","storage","store"],"created_at":"2024-11-20T09:28:57.028Z","updated_at":"2025-10-25T13:36:15.079Z","avatar_url":"https://github.com/2ue.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# localStorage增强库 (local-storage-js)\n\n[![npm version](https://img.shields.io/npm/v/local-storage-js.svg)](https://www.npmjs.com/package/local-storage-js)\n[![CI](https://github.com/2ue/storejs/workflows/CI/badge.svg)](https://github.com/2ue/storejs/actions/workflows/ci.yml)\n[![Release](https://github.com/2ue/storejs/workflows/Release%20and%20Publish/badge.svg)](https://github.com/2ue/storejs/actions/workflows/release.yml)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n[![Test Coverage](https://img.shields.io/badge/coverage-90%25+-brightgreen.svg)](https://github.com/2ue/storejs)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003e 对 `localStorage` 的全面增强，支持批量操作、复杂数据类型存储、TTL过期时间和 TypeScript 类型安全。提供了更强大、更灵活的本地存储解决方案。\n\n## ✨ 特性\n\n- 🚀 **完全兼容** - 保持原生 localStorage API 语义\n- 📦 **批量操作** - 支持数组和对象形式的批量存储/读取/删除\n- ⏰ **TTL过期** - 支持数据过期时间，自动清理过期数据\n- 🔒 **类型安全** - 完整的 TypeScript 类型定义\n- 🎯 **智能序列化** - 自动处理复杂数据类型\n- 🧪 **全面测试** - 48个测试用例，100% 测试覆盖率\n- 📝 **代码质量** - ESLint + Prettier 保证代码质量\n- 🔧 **零依赖** - 轻量级，无外部依赖\n\n## 📦 安装\n\n```bash\nnpm install --save local-storage-js\n```\n\n## 🚀 快速开始\n\n### 推荐用法 - ES6/TypeScript\n\n```typescript\n// 推荐: 显式导入 (最佳实践)\nimport store from 'local-storage-js';\n\nstore.setItem('user', { name: '张三', age: 25 });\nconst user = store.getItem('user'); // string | null\nconsole.log(user); // \"{\"name\":\"张三\",\"age\":25}\"\n```\n\n### 推荐用法 - CommonJS\n\n```javascript\n// 推荐: 显式导入 (最佳实践)\nconst store = require('local-storage-js').default;\n\nstore.setItem('config', { theme: 'dark', lang: 'zh-CN' });\nconst config = store.getItem('config');\nconsole.log(config); // \"{\"theme\":\"dark\",\"lang\":\"zh-CN\"}\"\n```\n\n\u003e **⚠️ CommonJS使用限制**  \n\u003e 由于localStorage是浏览器API，CommonJS主要适用于：\n\u003e - Electron应用（渲染进程）\n\u003e - 服务端渲染项目的客户端部分  \n\u003e - 使用构建工具的混合项目\n\u003e - Node.js环境需要模拟localStorage（如使用jsdom）\n\n### 浏览器环境 - Script 标签\n\n```html\n\u003c!-- 浏览器中会自动注册全局 store 对象 --\u003e\n\u003cscript src=\"./node_modules/local-storage-js/dist/store.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    // 浏览器环境可以直接使用全局 store\n    store.setItem('data', [1, 2, 3]);\n    console.log(store.getItem('data')); // \"[1,2,3]\"\n\u003c/script\u003e\n```\n\n### 其他使用方式\n\n```typescript\n// 方式1: 命名导入 (如果需要重命名)\nimport localStore from 'local-storage-js';\nlocalStore.setItem('key', 'value');\n\n// 方式2: CommonJS 完整形式\nconst { default: store } = require('local-storage-js');\nstore.setItem('key', 'value');\n```\n\n### CDN 引入方式\n\n```html\n\u003c!-- 通过CDN引入，自动注册全局 store 对象 --\u003e\n\u003cscript src=\"https://unpkg.com/local-storage-js@latest/dist/store.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    // CDN方式可以直接使用全局 store\n    store.setItem('data', { message: 'Hello from CDN!' });\n    console.log(store.getItem('data'));\n\u003c/script\u003e\n\n\u003c!-- 或者通过ES模块CDN引入 --\u003e\n\u003cscript type=\"module\"\u003e\n    // 副作用导入，适用于CDN场景\n    import 'https://unpkg.com/local-storage-js@latest/dist/store.js';\n    \n    // 全局 store 自动可用\n    store.setItem('moduleData', [1, 2, 3]);\n    console.log(store.getItem('moduleData'));\n\u003c/script\u003e\n```\n\n### ⚠️ 注意事项\n\n```typescript\n// ❌ 在Node.js/构建工具项目中不推荐副作用导入\n// import 'local-storage-js'; // 会注册全局 store，但不是最佳实践\n// store.setItem('key', 'value'); // 依赖全局变量，难以追踪来源\n\n// ✅ 推荐使用显式导入 (可追踪、类型安全)\nimport store from 'local-storage-js';\nstore.setItem('key', 'value');\n```\n\n## 📚 API 文档\n\n### setItem(key, value, options?, deepTraversal?)\n\n增强版 `localStorage.setItem`，支持多种数据类型、批量操作和TTL过期时间。\n\n#### 参数说明\n\n- `key`: `string | string[] | Record\u003cstring, any\u003e` - 存储键\n- `value`: `any` - 存储值（当 key 为 object 时可选）\n- `options`: `StorageOptions` - 存储选项，支持TTL设置\n  - `ttl`: `number` - 生存时间（毫秒）\n  - `expires`: `number` - 过期时间戳（毫秒）\n- `deepTraversal`: `boolean` - 是否深度遍历（默认 false）\n\n#### 使用示例\n\n```typescript\n// 导入库\nimport store from 'local-storage-js';\n\n// 基础用法\nstore.setItem('name', '张三');\nstore.setItem('age', 25);\nstore.setItem('user', { name: '张三', hobbies: ['游泳', '阅读'] });\n\n// TTL过期时间设置\nstore.setItem('session', 'abc123', { ttl: 5000 }); // 5秒后过期\nstore.setItem('token', 'jwt_token', { expires: Date.now() + 3600000 }); // 1小时后过期\n\n// 批量设置 - 数组形式\nstore.setItem(['key1', 'key2', 'key3'], ['value1', 'value2', 'value3']);\nstore.setItem(['theme', 'lang'], 'default'); // 所有 key 设置相同值\n\n// 批量设置带TTL - 数组形式\nstore.setItem(['cache1', 'cache2'], ['data1', 'data2'], { ttl: 10000 }); // 10秒后过期\n\n// 批量设置 - 对象形式\nstore.setItem({\n    theme: 'dark',\n    lang: 'zh-CN',\n    version: '1.0.0'\n});\n\n// 批量设置带TTL - 对象形式\nstore.setItem({\n    tempData1: 'value1',\n    tempData2: 'value2'\n}, { ttl: 30000 }); // 30秒后过期\n\n// 深度遍历模式\nstore.setItem({\n    user: { name: '张三' },\n    config: { theme: 'dark' }\n}, null, true);\n```\n\n### getItem(key)\n\n增强版 `localStorage.getItem`，支持批量获取、结构化数据返回，自动处理过期数据。\n\n#### 参数说明\n\n- `key`: `string | string[] | Record\u003cstring, string\u003e` - 要获取的键\n\n#### 返回值\n\n- 单个字符串键：返回 `string | null`（过期数据返回 null）\n- 数组键：返回 `(string | null)[]`\n- 对象键：返回对应结构的对象\n\n#### 使用示例\n\n```typescript\n// 导入库\nimport store from 'local-storage-js';\n\n// 单个获取\nconst name = store.getItem('name'); // string | null\n\n// 获取带TTL的数据（自动检查过期）\nconst session = store.getItem('session'); // 如果过期返回 null\n\n// 批量获取 - 数组形式\nconst values = store.getItem(['name', 'age', 'city']); \n// 返回: ['张三', '25', null]\n\n// 结构化获取 - 对象形式\nconst user = store.getItem({\n    username: 'name',\n    userAge: 'age',\n    city: 'city'\n});\n// 返回: { username: '张三', userAge: '25', city: null }\n```\n\n### getTTL(key)\n\n获取指定键的剩余TTL时间。\n\n#### 参数说明\n\n- `key`: `string` - 存储键\n\n#### 返回值\n\n- `number` - 剩余时间（毫秒）\n- `null` - 没有设置TTL\n- `-1` - 已过期\n\n#### 使用示例\n\n```typescript\nimport store from 'local-storage-js';\n\n// 设置TTL数据\nstore.setItem('temp', 'data', { ttl: 10000 }); // 10秒\n\n// 检查剩余时间\nconst remaining = store.getTTL('temp'); // 例如: 8500 (剩余8.5秒)\nconst noTTL = store.getTTL('name'); // null (没有TTL)\n\nsetTimeout(() =\u003e {\n    const expired = store.getTTL('temp'); // -1 (已过期)\n}, 11000);\n```\n\n### setTTL(key, ttl)\n\n为已存在的键设置TTL时间。\n\n#### 参数说明\n\n- `key`: `string` - 存储键\n- `ttl`: `number` - TTL时间（毫秒）\n\n#### 返回值\n\n- `boolean` - 是否设置成功\n\n#### 使用示例\n\n```typescript\nimport store from 'local-storage-js';\n\n// 先设置数据\nstore.setItem('data', 'some value');\n\n// 后续添加TTL\nconst success = store.setTTL('data', 5000); // 5秒后过期\nconsole.log(success); // true\n\n// 为不存在的key设置TTL\nconst failed = store.setTTL('nonexistent', 5000);\nconsole.log(failed); // false\n```\n\n### clearExpired()\n\n手动清理所有过期数据。\n\n#### 返回值\n\n- `string[]` - 被清理的键名列表\n\n#### 使用示例\n\n```typescript\nimport store from 'local-storage-js';\n\n// 设置一些带TTL的数据\nstore.setItem('temp1', 'data1', { ttl: 1000 }); // 1秒过期\nstore.setItem('temp2', 'data2', { ttl: 2000 }); // 2秒过期\nstore.setItem('permanent', 'data3'); // 永久数据\n\n// 等待过期\nsetTimeout(() =\u003e {\n    const cleaned = store.clearExpired();\n    console.log(cleaned); // ['temp1', 'temp2']\n    \n    console.log(store.hasKey('temp1')); // false\n    console.log(store.hasKey('permanent')); // true\n}, 3000);\n```\n\n### getItems()\n\n获取所有存储项，自动过滤过期数据。\n\n```typescript\nimport store from 'local-storage-js';\n\nconst allItems = store.getItems();\n// 返回: { name: '张三', age: '25', theme: 'dark' }\n// 注意: 过期数据和TTL元数据不会出现在结果中\n```\n\n### getKeys()\n\n获取所有存储键，自动过滤过期数据和TTL元数据。\n\n```typescript\nimport store from 'local-storage-js';\n\nconst allKeys = store.getKeys();\n// 返回: ['name', 'age', 'theme']\n// 注意: 过期数据和内部TTL元数据键不会出现在结果中\n```\n\n### removeItem(key)\n\n增强版 `localStorage.removeItem`，支持批量删除，自动清理相关TTL数据。\n\n#### 使用示例\n\n```typescript\nimport store from 'local-storage-js';\n\n// 单个删除（包括TTL数据）\nstore.removeItem('name');\n\n// 批量删除 - 数组形式\nstore.removeItem(['key1', 'key2', 'key3']);\n\n// 批量删除 - 对象形式（只删除对象的键，忽略值）\nstore.removeItem({\n    key1: 'anyValue',\n    key2: 'ignored'\n});\n```\n\n### clear()\n\n清空所有存储项。\n\n```typescript\nimport store from 'local-storage-js';\n\nstore.clear();\n```\n\n### hasKey(key)\n\n检查指定键是否存在且未过期。\n\n```typescript\nimport store from 'local-storage-js';\n\nconst exists = store.hasKey('name'); // boolean\n\n// 对于带TTL的数据，会自动检查是否过期\nstore.setItem('temp', 'data', { ttl: 5000 });\nconsole.log(store.hasKey('temp')); // true\n\nsetTimeout(() =\u003e {\n    console.log(store.hasKey('temp')); // false (已过期)\n}, 6000);\n```\n\n## ⏰ TTL过期功能\n\n本库支持完整的TTL (Time To Live) 过期时间功能，让你轻松管理临时数据。\n\n### 核心特性\n\n- 🕐 **灵活时间设置** - 支持`ttl`（相对时间）和`expires`（绝对时间）两种方式\n- 🔄 **自动清理** - 获取数据时自动检查并清理过期数据\n- 📦 **批量支持** - 所有批量操作都支持TTL设置\n- 🧹 **手动清理** - 提供`clearExpired()`方法手动清理过期数据\n- 🔍 **状态检查** - `getTTL()`方法查看剩余时间，`hasKey()`自动过滤过期数据\n- 🚫 **透明存储** - TTL元数据独立存储，不影响正常数据操作\n\n### 使用场景\n\n```typescript\nimport store from 'local-storage-js';\n\n// 1. 会话令牌管理\nstore.setItem('authToken', 'jwt_token_here', { ttl: 3600000 }); // 1小时后过期\nconst token = store.getItem('authToken'); // 过期后自动返回null\n\n// 2. 缓存数据管理\nstore.setItem('apiCache', responseData, { ttl: 300000 }); // 5分钟缓存\nconst cachedData = store.getItem('apiCache'); // 自动检查过期\n\n// 3. 临时表单数据\nstore.setItem('formDraft', formData, { ttl: 1800000 }); // 30分钟后清理\n\n// 4. 用户设置的临时配置\nstore.setItem('tempSettings', userConfig, { expires: Date.now() + 86400000 }); // 明天过期\n\n// 5. 批量缓存设置\nstore.setItem({\n    'cache_user_info': userData,\n    'cache_preferences': preferences\n}, { ttl: 1200000 }); // 20分钟后过期\n\n// 6. 定期清理过期数据\nsetInterval(() =\u003e {\n    const cleaned = store.clearExpired();\n    console.log(`清理了 ${cleaned.length} 个过期项:`, cleaned);\n}, 60000); // 每分钟清理一次\n```\n\n### TTL最佳实践\n\n```typescript\nimport store from 'local-storage-js';\n\n// 1. 检查数据是否仍有效\nfunction getCachedData(key: string) {\n    const ttl = store.getTTL(key);\n    if (ttl === null) {\n        console.log('数据没有设置TTL，永久有效');\n    } else if (ttl === -1) {\n        console.log('数据已过期');\n        return null;\n    } else {\n        console.log(`数据还有 ${Math.round(ttl / 1000)} 秒过期`);\n    }\n    return store.getItem(key);\n}\n\n// 2. 延长数据有效期\nfunction extendTTL(key: string, additionalTime: number) {\n    const currentTTL = store.getTTL(key);\n    if (currentTTL !== null \u0026\u0026 currentTTL !== -1) {\n        store.setTTL(key, currentTTL + additionalTime);\n        return true;\n    }\n    return false;\n}\n\n// 3. 条件性数据刷新\nfunction getOrRefreshCache(key: string, refreshFn: () =\u003e any, ttl: number) {\n    const cached = store.getItem(key);\n    if (cached === null) {\n        const fresh = refreshFn();\n        store.setItem(key, fresh, { ttl });\n        return fresh;\n    }\n    return cached;\n}\n```\n\n## 🛠️ 开发\n\n### 环境要求\n\n- Node.js \u003e= 14\n- TypeScript \u003e= 4.0\n\n### 开发命令\n\n```bash\n# 安装依赖\nnpm install\n\n# 开发构建\nnpm run build\n\n# 运行测试\nnpm test\n\n# 测试覆盖率\nnpm run test:coverage\n\n# 代码格式化\nnpm run format\n\n# 代码质量检查\nnpm run lint\n\n# 自动修复\nnpm run fix\n\n# 完整检查（格式 + 质量）\nnpm run check\n```\n\n### 项目结构\n\n```\nlocal-storage-js/\n├── src/                    # 源代码\n│   └── store.ts           # 主要实现文件\n├── test/                  # 测试文件\n│   └── store.test.ts      # 完整测试套件\n├── dist/                  # 构建输出\n│   ├── store.js           # 编译后的 JavaScript\n│   └── store.d.ts         # TypeScript 类型定义\n├── .prettierrc.json       # Prettier 配置\n├── eslint.config.js       # ESLint 配置\n├── tsconfig.json          # TypeScript 配置\n└── jest.config.json       # Jest 测试配置\n```\n\n## 📊 数据类型处理\n\n### 自动序列化\n\n库会自动处理不同数据类型的序列化：\n\n```typescript\nimport store from 'local-storage-js';\n\nstore.setItem('string', 'hello');      // 直接存储\nstore.setItem('number', 42);           // 转换为 '42'\nstore.setItem('boolean', true);        // 转换为 'true'\nstore.setItem('array', [1, 2, 3]);     // JSON.stringify\nstore.setItem('object', {a: 1});       // JSON.stringify\nstore.setItem('null', null);           // 转换为空字符串\nstore.setItem('undefined', undefined); // 转换为空字符串\nstore.setItem('nan', NaN);             // 转换为空字符串\n```\n\n### 特殊值处理\n\n- `null`、`undefined`、`NaN` 会被转换为空字符串 `''`\n- 复杂对象会通过 `JSON.stringify` 序列化\n- 循环引用对象会抛出错误\n\n## 🔧 TypeScript 支持\n\n完整的 TypeScript 类型定义，包含TTL功能：\n\n```typescript\n// TTL选项接口\ninterface StorageOptions {\n    ttl?: number;      // 生存时间，毫秒为单位\n    expires?: number;  // 过期时间戳，毫秒为单位\n}\n\ninterface LocalStorageEnhanced {\n    // setItem方法重载 - 支持TTL\n    setItem\u003cT = any\u003e(key: string, value: T): void;\n    setItem\u003cT = any\u003e(key: string, value: T, options: StorageOptions): void;\n    setItem\u003cT = any\u003e(keys: string[], values: T[] | T, deepTraversal?: boolean): void;\n    setItem\u003cT = any\u003e(keys: string[], values: T[] | T, options: StorageOptions, deepTraversal?: boolean): void;\n    setItem\u003cT = any\u003e(keyValueMap: Record\u003cstring, T\u003e, _?: null, deepTraversal?: boolean): void;\n    setItem\u003cT = any\u003e(keyValueMap: Record\u003cstring, T\u003e, options: StorageOptions | null, deepTraversal?: boolean): void;\n    \n    // getItem方法 - 自动处理过期数据\n    getItem(key: string): string | null;\n    getItem(keys: string[]): (string | null)[];\n    getItem\u003cT = Record\u003cstring, string | null\u003e\u003e(keyStructure: Record\u003cstring, string\u003e): T;\n    \n    // 基础方法 - 增强过期数据处理\n    getItems(): Record\u003cstring, string | null\u003e;\n    getKeys(): string[];\n    \n    removeItem(key: string): void;\n    removeItem(keys: string[]): void;\n    removeItem(keyValueMap: Record\u003cstring, any\u003e): void;\n    \n    clear(): void;\n    hasKey(key: string | null | undefined): boolean;\n    \n    // TTL相关新方法\n    getTTL(key: string): number | null;      // 获取剩余TTL时间\n    setTTL(key: string, ttl: number): boolean; // 为已存在的key设置TTL\n    clearExpired(): string[];                // 手动清理所有过期数据\n}\n\ndeclare global {\n    var store: LocalStorageEnhanced;\n}\n```\n\n## 📝 更新日志\n\n### v0.0.9 (Latest)\n\n- ⏰ **重大功能**: 新增完整的TTL过期时间支持\n- 🕐 **灵活时间设置**: 支持`ttl`和`expires`两种时间设置方式\n- 🔄 **自动清理**: 获取数据时自动检查并清理过期数据\n- 📦 **批量TTL**: 所有批量操作都支持TTL设置\n- 🧹 **手动清理**: 新增`clearExpired()`方法手动清理过期数据\n- 🔍 **状态检查**: 新增`getTTL()`和`setTTL()`方法管理TTL\n- 🧪 **测试完善**: 新增12个TTL专项测试，总测试数达到48个\n- 🚫 **透明存储**: TTL元数据独立存储，不干扰正常数据操作\n- 📚 **文档更新**: 完善TTL功能文档和最佳实践指南\n\n### v0.0.8\n\n- 🔄 **重大重构**: 完全迁移到 TypeScript\n- 🧪 **测试完善**: 新增 36 个综合测试用例，覆盖率 100%\n- 🔧 **开发工具**: 集成 ESLint + Prettier 代码质量工具\n- 🐛 **Bug 修复**: 修复多个核心逻辑错误\n- 📚 **文档更新**: 完善 TypeScript 类型定义和使用示例\n- ⚡ **性能优化**: 优化类型检测和数据处理逻辑\n\n## 🤝 贡献\n\n欢迎提交 Issue 和 Pull Request！\n\n### 贡献步骤\n\n1. Fork 项目\n2. 创建特性分支 (`git checkout -b feature/amazing-feature`)\n3. 提交更改 (`git commit -m 'Add amazing feature'`)\n4. 推送到分支 (`git push origin feature/amazing-feature`)\n5. 开启 Pull Request\n\n### 开发规范\n\n- 遵循现有代码风格\n- 添加相应的测试用例\n- 确保所有测试通过\n- 运行 `npm run check` 确保代码质量\n\n## 📄 许可证\n\n[MIT License](https://opensource.org/licenses/MIT)\n\n## ⚠️ 注意事项\n\n- 本库未对不支持 localStorage 的环境做兼容处理\n- 使用前请确保运行环境支持 localStorage\n- 存储的数据会被转换为字符串格式\n- 大量数据存储可能影响性能，请合理使用\n\n## 📞 支持\n\n- 🐛 Bug 报告: [GitHub Issues](https://github.com/2ue/storejs/issues)\n- 💬 讨论交流: [GitHub Discussions](https://github.com/2ue/storejs/discussions)\n- 📧 邮件联系: jie746635835@163.com\n\n---\n\n如果这个库对你有帮助，请给个 ⭐️ Star 支持一下！","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2ue%2Flocal-storage-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2ue%2Flocal-storage-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2ue%2Flocal-storage-js/lists"}