mm_cachebase 1.8.5 → 1.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/config/cachebase.config.json +11 -0
- package/config/cachebase.const.json +16 -0
- package/index.js +2307 -1632
- package/index_old.js +2521 -0
- package/package.json +2 -2
- package/simple_test.js +21 -70
- package/simple_test_direct.js +27 -0
- package/test.js +449 -424
- package/test_cache/test_file_operations.json +1 -0
- package/test_cache/undefined.cache.json +12 -0
- package/test_new_methods.js +170 -0
- package/compatibility_table.md +0 -101
- package/test_add_direct_save.js +0 -60
- package/test_add_if_not_exists.js +0 -50
- package/test_add_method.js +0 -44
- package/test_cache/scope1.cache.json +0 -5
- package/test_cache/scope2.cache.json +0 -5
- package/test_cache/scope3.cache.json +0 -5
- package/test_cache/test_scope.cache.json +0 -5
- package/test_compatibility.js +0 -109
- package/test_compatibility_improvements.js +0 -147
- package/test_list_and_decr_compatibility.js +0 -99
- package/test_multi_file_persistence.js +0 -160
- package/test_persistence.js +0 -138
- package/test_redis_behavior.js +0 -57
- package/test_undocumented_methods.js +0 -57
package/README.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
一个轻量级的本地缓存类库,提供了与Redis兼容的缓存操作接口,支持过期时间设置、哈希表操作、数值操作、字符串操作等功能,以及完整的事件通知系统。
|
|
4
4
|
|
|
5
|
+
## 项目信息
|
|
6
|
+
|
|
7
|
+
- **当前版本**: 1.8.7
|
|
8
|
+
- **更新日期**: 2024-12-23
|
|
9
|
+
- **Gitee地址**: [https://gitee.com/qiuwenwu91/mm_cachebase](https://gitee.com/qiuwenwu91/mm_cachebase)
|
|
10
|
+
- **Node.js 版本要求**: >= 14.0.0(推荐 16.0.0 及以上)
|
|
11
|
+
|
|
5
12
|
## 特点
|
|
6
13
|
|
|
7
14
|
- **Redis兼容API**:实现了与npm redis模块相似的接口,便于无缝切换
|
|
@@ -520,6 +527,33 @@ async function batchExample() {
|
|
|
520
527
|
6. 事件回调函数中的 `cancel` 标志只在前置事件中有效,后置事件中修改不会产生效果
|
|
521
528
|
7. 所有事件参数都遵循统一的格式,包含key、value、result、error和cancel等字段
|
|
522
529
|
|
|
530
|
+
## 贡献指南
|
|
531
|
+
|
|
532
|
+
欢迎参与mm_cachebase项目的开发和改进!以下是贡献代码的基本步骤:
|
|
533
|
+
|
|
534
|
+
1. **Fork 仓库**:在Gitee上Fork项目到您的账户
|
|
535
|
+
2. **克隆仓库**:`git clone https://gitee.com/您的用户名/mm_cachebase.git`
|
|
536
|
+
3. **创建分支**:`git checkout -b feature/your-feature-name`
|
|
537
|
+
4. **提交更改**:`git commit -m "feat: 添加新功能描述"`
|
|
538
|
+
5. **推送分支**:`git push origin feature/your-feature-name`
|
|
539
|
+
6. **创建PR**:在Gitee上提交Pull Request
|
|
540
|
+
|
|
541
|
+
## 问题反馈
|
|
542
|
+
|
|
543
|
+
如果您在使用过程中遇到任何问题或有改进建议,请通过以下方式反馈:
|
|
544
|
+
|
|
545
|
+
- **Gitee Issues**:[https://gitee.com/qiuwenwu91/mm_cachebase/issues](https://gitee.com/qiuwenwu91/mm_cachebase/issues)
|
|
546
|
+
- **NPM 链接**:[https://www.npmjs.com/package/mm_cachebase](https://www.npmjs.com/package/mm_cachebase)
|
|
547
|
+
|
|
548
|
+
## 鸣谢
|
|
549
|
+
|
|
550
|
+
感谢所有为mm_cachebase项目做出贡献的开发者和用户!
|
|
551
|
+
|
|
552
|
+
## 相关链接
|
|
553
|
+
|
|
554
|
+
- **Node.js 官方文档**:[https://nodejs.org/docs/latest/api/](https://nodejs.org/docs/latest/api/)
|
|
555
|
+
- **Redis 命令参考**:[https://redis.io/commands/](https://redis.io/commands/)
|
|
556
|
+
|
|
523
557
|
## 许可证
|
|
524
558
|
|
|
525
559
|
MIT
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CACHE_TYPES": {
|
|
3
|
+
"STRING": "string",
|
|
4
|
+
"LIST": "list",
|
|
5
|
+
"SET": "set",
|
|
6
|
+
"HASH": "hash",
|
|
7
|
+
"NONE": "none"
|
|
8
|
+
},
|
|
9
|
+
"DEFAULT_CONFIG": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"persist": false,
|
|
12
|
+
"file_path": "./data/cachebase.data",
|
|
13
|
+
"save_interval": 60000,
|
|
14
|
+
"retry_attempts": 3
|
|
15
|
+
}
|
|
16
|
+
}
|