{"id":27881038,"url":"https://github.com/tinhour/nodememorydb","last_synced_at":"2026-02-12T08:02:25.550Z","repository":{"id":72884733,"uuid":"122624925","full_name":"tinhour/nodeMemoryDB","owner":"tinhour","description":"this is a simple memory DB service build in nodejs","archived":false,"fork":false,"pushed_at":"2025-02-18T01:17:34.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-29T11:04:41.425Z","etag":null,"topics":["memorydb","simpledatabase"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nodememorydb","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/tinhour.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":"2018-02-23T13:30:20.000Z","updated_at":"2025-02-18T01:17:38.000Z","dependencies_parsed_at":"2025-01-22T09:03:06.521Z","dependency_job_id":"d730c538-0d6b-470b-b6b5-1f572da5aaaa","html_url":"https://github.com/tinhour/nodeMemoryDB","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"7c2ca97ac560a8f94fa2f60457cd4f9919ac8902"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinhour%2FnodeMemoryDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinhour%2FnodeMemoryDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinhour%2FnodeMemoryDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinhour%2FnodeMemoryDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinhour","download_url":"https://codeload.github.com/tinhour/nodeMemoryDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442518,"owners_count":21748448,"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":["memorydb","simpledatabase"],"created_at":"2025-05-05T04:44:43.788Z","updated_at":"2026-02-12T08:02:20.504Z","avatar_url":"https://github.com/tinhour.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nodeMemoryDB\n\n[English](./README_EN.md) | 简体中文\n\n该项目是一个基于 Node.js 构建的轻量级内存数据库服务，旨在为开发者提供快速、简便的数据存储解决方案。它支持 RESTful API 接口，允许用户通过简单的 HTTP 请求进行数据的增删改查操作。无论是需要临时存储数据还是进行快速原型开发，这个内存数据库都能满足需求。项目具有易于使用的特性，用户只需简单的几行代码即可启动服务，并通过直观的 API 进行数据交互。此外，项目还支持基础的 CRUD 操作，确保用户能够灵活管理数据。\n\n## 环境要求\n\n- Node.js \u003e= 14.0.0\n- npm \u003e= 6.0.0\n\n## 功能特点\n\n- 轻量级内存数据库\n- RESTful API 接口\n- 简单易用\n- 支持基础的 CRUD 操作\n\n## 安装\n\n```bash\nnpm install nodeMemoryDB\n```\n\n## 使用方法\n\n启动服务器：\n\n```bash\nnpm run start\n```\n\n服务器将在 81 端口启动，作为内存数据库服务运行。\n\n## API 接口\n\n### 数据操作\n\n#### 获取数据\n- GET `/get`\n  - 参数：\n    - `key`：（可选）键名。如果不提供，则返回所有数据\n    - `meta`：（可选）设为 1 时返回元数据\n\n请求示例：\n```bash\n# 获取指定键的数据\ncurl http://localhost:81/get?key=abc\n\n# 获取指定键的数据及元数据\ncurl http://localhost:81/get?key=abc\u0026meta=1\n\n# 获取所有数据\ncurl http://localhost:81/get\n```\n\n响应示例：\n```json\n{\n  \"message\": \"get abc success\",\n  \"data\": \"123\"\n}\n```\n\n#### 设置数据\n- GET/POST `/set`\n  - 参数：\n    - `key`：键名\n    - `value`：值\n\n请求示例：\n```bash\n# GET 方式\ncurl \"http://localhost:81/set?key=abc\u0026value=123\"\n\n# POST 方式\ncurl -X POST http://localhost:81/set \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"key\": \"abc\", \"value\": \"123\"}'\n```\n\n响应示例：\n```json\n{\n  \"message\": \"abc is stored\",\n  \"data\": \"success\"\n}\n```\n\n#### 删除数据\n- GET/POST `/del`\n  - 参数：\n    - `key`：要删除的键名\n\n请求示例：\n```bash\ncurl \"http://localhost:81/del?key=abc\"\n```\n\n响应示例：\n```json\n{\n  \"message\": \"abc is deleted\",\n  \"data\": \"success\"\n}\n```\n\n#### 清空数据库\n- GET/POST `/clear`\n  - 注意：只允许从本地（127.0.0.1）访问\n\n请求示例：\n```bash\ncurl http://localhost:81/clear\n```\n\n响应示例：\n```json\n{\n  \"message\": \"DB is cleared\",\n  \"data\": \"success\"\n}\n```\n\n## 项目依赖\n\n- express: ^4.17.1\n- body-parser: ^1.19.0\n- cors: ^2.8.5\n\n## 许可证\n\nMIT ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinhour%2Fnodememorydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinhour%2Fnodememorydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinhour%2Fnodememorydb/lists"}