@barelyhuman/fs-route-manifest
v0.0.6
Published
Opinionated file system manifest generator
Downloads
17
Maintainers
Readme
fs-route-manifest
Simple manifest generation utilities for file system routing
Basic Usage
; npm i @barelyhuman/fs-route-manifest
import { generateRoutes, readDirectory, stringify } from "../src/index.ts";
// Read the routes directory and give all
// file paths
const filePaths = readDirectory("./routes");
// Generate a manifest or hashmap of information from the file path data from above
const urlManifest = generateRoutes("/routes", filePaths);
// stringify this data, so you can store it on the filesystem for caching and work avoidance
console.log(stringify(urlManifest));