| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Generate dynamic and callable LiteGraph nodes from OpenAPI specifications, enabling seamless API integration in a visual programming environment.
npm install @soldarlabs/oapi-litegraph-nodegenThe project includes a Next.js-based demo that showcases the library's capabilities with hot-reloading support for development:
# Navigate to the demo directory.
cd demo
# Install dependencies.
npm install
# Start the development server.
npm run devVisit http://localhost:3000 to see the demo in action.
import {
NodeGenerator,
optimizeCanvas,
} from "@soldarlabs/oapi-litegraph-nodegen";
import { LGraph, LGraphCanvas } from "litegraph.js";
// Create a new graph.
const graph = new LGraph();
// Apply canvas optimizations (optional).
optimizeCanvas("#graphcanvas", graph);
// Initialize the node generator.
const generator = new NodeGenerator();
// Add an OpenAPI specification.
await generator.addSpec("myApi", "./openapi.yaml");
// Register nodes from the spec.
generator.registerNodes();
// Create and start the canvas.
canvas.start();The demo uses Vite for hot module reloading and fast development:
# Clone the repository.
git clone https://github.com/soldarlabs/oapi-litegraph-nodegen.git
cd oapi-litegraph-nodegen
# Install dependencies.
npm install
# Build the library.
npm run build
# Start the demo.
npm run start:demoThe demo will be available at http://localhost:5173 with hot reloading enabled.
const generator = new NodeGenerator({
typePrefix: "MyAPI/", // Prefix for generated node types.
groupByTag: true, // Group nodes by OpenAPI tags.
widgetMappings: {
"string:date": "date-picker",
"string:color": "color-picker",
},
});The library automatically selects appropriate widgets based on OpenAPI parameter types:
The project uses modern tooling:
MIT License - see LICENSE for details.
| Back | FazBrowse Home | New Git URL |