reaxcode
v0.1.11
Published
A lightweight HTTP server with NodeTools file operations API for front-end development and debugging.
Readme
ReaxCode
轻量级 HTTP 静态服务器,内置 NodeTools 文件操作 API,用于前端开发调试与 AI 编程助手场景。
Android端APP访问: https://reaxcode.com
安装
npm install -g reaxcode安装后即可全局使用 reaxcode 命令。
使用
启动静态服务器
# 在任意目录下执行
reaxcode
# 或直接用 Node.js 运行
node server.js服务将:
- 托管当前目录下的
dist目录(不存在则回退到web目录)的静态文件 - 提供
/api/callNativeAPI 端点,支持文件操作与 Shell 命令执行
API 说明
POST /api/callNative,JSON 请求体:
{
"methodName": "readLines",
"args": ["./test.txt", 1, 10],
"sessionId": "optional-session-id"
}可用方法:exec、sleep、listFiles、readLines、replaceLines、insertLines、insertAfter、createFile、appendLines、undoEdit。
NodeTools 库直接引用
const { NodeTools } = require('reaxcode/nodeTools');
const tools = new NodeTools();
const result = await tools.readLines('./file.txt', 1, 100);