🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

routenest

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

routenest

An extension for Express.js to manage routes and middlewares efficiently.

unpublished
latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

🌐 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

  • Import the library:
import routeNest from 'routenest'
  • Organize your routes in a directory (e.g., /api):
/api
  /users
    get.js
    post.js
    /[id]
      get.js
      put.js
  • 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.

Keywords

express

FAQs

Package last updated on 27 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts