https://github.com/frolleks/pathless
A lightweight, flexible routing library for JavaScript.
https://github.com/frolleks/pathless
http pathless
Last synced: 3 months ago
JSON representation
A lightweight, flexible routing library for JavaScript.
- Host: GitHub
- URL: https://github.com/frolleks/pathless
- Owner: frolleks
- License: mit
- Created: 2024-09-14T02:51:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-28T02:07:59.000Z (over 1 year ago)
- Last Synced: 2025-10-01T20:59:16.886Z (6 months ago)
- Topics: http, pathless
- Language: TypeScript
- Homepage:
- Size: 1.74 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pathless
A lightweight, flexible routing library for JavaScript. Designed for simplicity, Pathless provides an intuitive API for handling HTTP requests and organizing your routes.
```js
// CJS
const pathless = require("pathless");
// ESM
import pathless from "pathless";
const app = pathless();
app.get("/", (req, res) => res.send("Hello world!"));
app.listen(3000, () => console.log("Server is listening on port 3000"));
```
## Features
- **Flexible Routing**: Easily define routes for various HTTP methods, including support for dynamic and wildcard routes.
- **Middleware Support**: Add global or route-specific middleware to handle tasks like authentication, logging, and more.
- **Modular Routers**: Organize your application into reusable routers for better scalability and maintainability.
## Quick Start
```bash
$ npm i pathless@latest
$ yarn add pathless@latest
$ pnpm i pathless@latest
```
## Comparison with other frameworks
| Stat | Framework | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
| ----------- | --------- | ------ | ------ | ------ | ------ | --------- | -------- | ------ |
| **Req/Sec** | Pathless | 27,215 | 27,215 | 32,447 | 33,983 | 31,973.82 | 1,827.87 | 27,214 |
| | Express | 6,451 | 6,451 | 8,279 | 8,495 | 8,023.82 | 609.14 | 6,451 |
| | Hono | 28,079 | 28,079 | 34,399 | 35,327 | 33,888.73 | 1,882.39 | 28,065 |
(from [frolleks/nodejs-http-framework-benchmark](https://github.com/frolleks/nodejs-http-framework-benchmark))
## Documentation
Visit the [repository's Wiki](https://github.com/frolleks/pathless/wiki).
## License
MIT License