1.1.2 • Published 4 years ago
@egoist/fs-routes v1.1.2
💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.
@egoist/fs-routes
This is a utility extracted from SvelteKit, basically it loads routes from a specific directory, with layouts support.
Install
npm i @egoist/fs-routes
Usage
import { loadRoutes } from '@egoist/fs-routes'
const { routes, components } = await loadRoutes({
routes_dir: './src/routes',
cwd: process.cwd(), // optional
page_extensions: [],
match_api: (file) => file.endsWith('.ts'),
})
License
MIT © EGOIST x SvelteKit authors