0.1.1 ā€¢ Published 8 months ago

routenest v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

šŸŒ routeNest

šŸ›  Easily structure and manage your Express.js routes using a directory-based approach. šŸš€

šŸ“¦ Installation

npm install routenest

šŸŒŸ Features

šŸ“‚ Automatic Express route generation based on directory structure.

āš™ļø Supports middlewares and RESTful methods.

šŸŒ² Clean and organized route management using a tree structure.

šŸ“– Usage

  1. Import the library:
import routeNest from 'routenest'
  1. Organize your routes in a directory (e.g., /api):
/api
  /users
    get.js
    post.js
    /[id]
      get.js
      put.js
  1. Initialize with your routes directory:
const app = routeNest.initExpress('/api')

app.listen(3000)

šŸ’” By default, routeNest looks into the /api directory, but you can customize the directory path by passing it to initExpress.

šŸ“˜ API

initExpress(directoryPath: string)

šŸ” Initializes the Express application with routes and middlewares defined in the provided directory.

Parameters:

  • directoryPath: (Optional) The path to the directory containing your routes. Defaults to /api.

Returns:

  • An initialized Express application.

šŸ¤ Contributing

If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

šŸ“ License

This project is licensed under the MIT License.

0.1.1

8 months ago

0.1.0

8 months ago