Node-initdb is a Visual Studio Code extension designed to simplify the process of initializing database configurations and structures in Node.js projects. With support for both Mongoose and Sequelize, this extension streamlines the setup of database connections and modules, saving developers valuable time.
Features
1. Setup Project
Easily set up your Node.js project with essential configurations and a database connection.
Prompt-based project initialization.
Supports both Mongoose (MongoDB) and Sequelize (SQL databases).
Automatically generates the required files and configurations.
2. Add Module
Quickly add new modules to your project with just a few inputs.
Supports Mongoose and Sequelize models.
Automatically creates routes and registers them.
Copies the route registration snippet to your clipboard for quick integration.
Installation
Open Visual Studio Code.
Go to the Extensions View (Ctrl+Shift+X or Cmd+Shift+X on macOS).
Search for Node-initdb.
Click Install.
Usage
1. Setting Up the Project
Open a workspace in VS Code.
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Type Node-initdb : Setup Project and select the command.
Follow the prompts to enter details such as package name, version, description, and database type (Mongoose or Sequelize).
The extension will initialize the project and create necessary configurations.
2. Adding a Module
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Type Node-initdb : Add Module and select the command.
Enter the module name when prompted.
Choose the database type (Mongoose or Sequelize).
The extension generates the module files and copies the route registration snippet to your clipboard.
Commands
Command
Description
Node-initdb : Setup Project
Sets up the project with database configuration.
Node-initdb : Add Module
Adds a new module and generates route files.
Key Features
Database Support
Mongoose for MongoDB.
Sequelize for SQL databases (MySQL, PostgreSQL, etc.).
Route Registration
Automatically registers routes for added modules.
Provides a ready-to-use route snippet for quick integration.