# file-store **Repository Path**: d7c/file-store ## Basic Information - **Project Name**: file-store - **Description**: 使用 JSON 文件存储和获取数据。 - **Primary Language**: NodeJS - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: http://www.d7c.top/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-15 - **Last Updated**: 2022-09-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # file-store ## 介绍 file-store 是一个使用 JSON 文件存储和获取数据。 ## 软件架构 使用 NodeJS 核心模块 node:fs 模块读写文件,实现存储、修改和读取数据。 ## 安装教程 ### 1. 安装开发依赖模块 ``` 1、运行跨平台设置和使用环境变量的脚本 npm install --save-dev cross-env ``` ### 2. 安装项目依赖模块 ``` 1、命令行参数解析 npm install --save minimist 2、记录日志 npm install --save log4js 3、生成唯一主键 npm install --save uuid 4、锁定异步代码,https://www.npmjs.com/package/async-lock,https://github.com/rogierschouten/async-lock npm install --save async-lock ``` ## 使用说明 ### 1. 克隆并安装项目,在项目根目录下执行 ``` npm install ``` ### 2. 测试命令 ``` npm run test ``` ### 3. 安装方式 ``` 本地安装该包:npm install ../file-store 从 Gitee 上安装该包:npm install git+https://gitee.com/d7c/file-store.git#master ``` ### 4. 使用方式 ``` const { FileStore, logger } = require('../src/index.js'); const store = FileStore.build('E:\\Trash\\data'); ``` ## 捐助打赏 如果您觉得我们的开源软件对你有所帮助,请扫下方二维码打赏我们一杯咖啡。 ![微信收款码](https://images.gitee.com/uploads/images/2021/0222/174352_b22739f5_1070311.jpeg "微信收款码.jpg") ![微信赞赏码](https://images.gitee.com/uploads/images/2021/0222/174521_67e18b39_1070311.jpeg "微信赞赏码.jpg") ![支付宝收款码](https://images.gitee.com/uploads/images/2021/0222/174540_94a9ac41_1070311.jpeg "支付宝收款码.jpg") ## 参与贡献 1. Fork 本仓库 2. 新建 file-store_xxx 分支 3. 提交代码 4. 新建 Pull Request ## 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)