node ./test/v15/forEndPoints.js
The generator reads end-points.js, collects import statements, router.get(), router.post(), router.put(), and router.delete() methods, calculates the insertion position, and updates the file automatically.
import funcFromfind from "./find/controller.js";
router.get("/find/:ledgerName", ...);
import funcFromfind from "./find/controller.js";
import funcFromshowAll from "./showAll/controller.js";
router.get("/find/:ledgerName", ...);
router.get("/funcFromshowAll", ...);
node ./test/v15/forRoutesEnd.js
The generator reads routes.js, finds router imports and router.use() statements, determines the correct insertion location, and updates the routing file automatically.
import { router as routerFromFold1 } from "./Fold1/end-points.js";
router.use("/table1", routerFromFold1);
import { router as routerFromFold2 } from "./Fold2/end-points.js";
router.use("/routerFromFold2", Fold2);
Read Source
↓
Pattern Collector
↓
Regex Matching
↓
Story Builder
↓
Return Indexes
↓
Generator Updates File
pattern-collector-anyjs-story acts like a smart code reader.
Instead of blindly searching text, it understands the structure of JavaScript routing files and identifies exactly where new code should be inserted.