endpoint-extractor
v1.0.2
Published
[English](#english-version)
Readme
📘 EndpointExtractor
English Version
🔹 Overview
EndpointExtractor is a Node.js library built on top of Tree-sitter and a custom ApiGenerator.
It scans Java(etc.) source code and extracts API endpoint information (e.g., method, URL, parameters, request/response schema), making it useful for API documentation, reverse engineering, and testing automation.
✨ Features
- 🚀 Automatic Endpoint Extraction – Supports HTTP annotations (
@GetMapping,@PostMapping, etc.) - 📦 Structured Metadata – Extracts parameters from headers, query, path, cookies, and body
- 🧩 Java Type → JSON Schema conversion
- 📑 Stable Unique Endpoint ID generation
- ⚡ Robust & Scalable – Designed for large Java projects
📥 Installation
npm install endpoint-extractor⚡ Usage Example
const { EndpointExtractor } = require("endpoint-extractor");
(async () => {
const extractor = new EndpointExtractor({ rootDir: "./my-java-project" });
const { list, stats, issues } = await extractor.extractEndpoints();
console.log("Extracted Endpoints:", list);
console.log("Project Stats:", stats);
console.log("Issues:", issues);
})();📊 Example Output
{
"name": "save",
"method": "POST",
"url": "/role/save",
"target_id": "1839471982734",
"request": {
"query": { "parameter": [] },
"body": {
"mode": "json",
"raw": "{\"id\":1,\"name\":\"Admin\"}",
"raw_schema": { "type": "object", "properties": { ... } }
}
}
}🔧 Options
| Option | Type | Default | Description |
| ----------- | ------ | --------------- | ---------------------------------- |
| rootDir | string | process.cwd() | Root directory of the Java project |
| concurrency | number | 32 | File parsing concurrency level |
📜 License
MIT License © 2025
