@barelyhuman/fs-route-manifest
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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));

API Reference

TypeAPI →

Package Sidebar

Install

npm i @barelyhuman/fs-route-manifest

Weekly Downloads

4

Version

0.0.6

License

MIT

Unpacked Size

14.8 kB

Total Files

6

Last publish

Collaborators

  • barelyreaper