Node.js utilities tool for TWAI (Test With AI) testing framework
npm install @twai/tool-nodeNode.js filesystem and execution tool for the TWAI (Test With AI) testing framework.
``bash`
pnpm add @twai/tool-node
`typescript
import { NodeTool, createNodeTools } from "@twai/tool-node";
const node = new NodeTool(process.cwd());
// File operations
const content = await node.readFile("package.json");
await node.writeFile("output.txt", "Hello World");
const files = await node.listDir("./src");
// Command execution
const result = await node.exec("npm test");
console.log(result.stdout);
// As AI tool definitions
const tools = createNodeTools(node);
`
- NodeTool - Node.js utilities classcreateNodeTools
- - Create AI tool definitionsExecResult
- Types: , FileInfo`