Description
Node File Router is an open-source library that brings file-based routing to Node.js APIs. Instead of registering routes by hand, you lay out files and folders, and the directory structure becomes your URL structure, much like the routing in Next.js and Nuxt, which inspired its interface. It supports dynamic routes with wildcard parameters, so a file named [pid].js inside a products folder can handle any product ID. The library is not tied to one framework and works with plain Node.js, Bun, Express.js and WebSockets, and a custom adapter option lets you plug it into other setups. It supports CommonJS and ES modules, includes TypeScript support, has no dependencies and reports 100% test coverage. The documentation covers getting started, usage, route matching, custom adapters and middlewares.…
Highlights
- File and folder structure defines API routes
- Dynamic routes with wildcard parameters
- Works with Node.js, Bun, Express.js and WebSockets
- CommonJS, ES modules and TypeScript support
- Zero dependencies and 100% test coverage
- Middleware and custom adapter support
Ratings & Reviews
No ratings yet
Be the first to rate Node File Router.
People also visit
Node File Router FAQ
What is Node File Router?
A library for defining a Node.js API with file-based routing, where files and folders map to routes.
Which runtimes and frameworks does it work with?
Plain Node.js, Bun, Express.js and WebSockets, and you can write a custom adapter for others.
Does it support TypeScript?
Yes, TypeScript support is included, along with CommonJS and ES modules.
Does it have dependencies?
No. It has zero dependencies and the project reports 100% test coverage.
What are the best Node File Router alternatives?
Popular alternatives to Node File Router include ExpressJS, Docs and Content. See all Node File Router alternatives








