reaction-code
v0.0.1
Published
A lightweight HTTP server with NodeTools file operations API for front-end development and debugging.
Maintainers
Readme
NexCode
A lightweight HTTP server with NodeTools file operations API for front-end development and debugging.
Install
npm install -g nexcodeUsage
Start HTTP server
nexcodeOr directly with Node.js:
node server.jsThe server will:
- Serve static files from the
distdirectory (orwebdirectory as fallback) in the current working directory - Provide an API endpoint
/api/callNativefor file operations and shell commands
API
POST /api/callNative with JSON body:
{
"methodName": "readLines",
"args": ["./test.txt", 1, 10],
"sessionId": "optional-session-id"
}Available methods: exec, sleep, listFiles, readLines, replaceLines, insertLines, insertAfter, createFile, appendLines, undoEdit.
NodeTools Library
Require the library directly:
const { NodeTools } = require('nexcode/nodeTools');
const tools = new NodeTools();
const result = await tools.readLines('./file.txt', 1, 100);License
MIT
