Package Exports
- node-initdb
- node-initdb/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-initdb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-initdb
node-initdb is a CLI tool for initializing database configurations and structures in Node.js projects.

Installation
You can install node-initdb globally using npm:
npm install -g node-initdbUsage
To use node-initdb, navigate to your project directory and run one of the following commands based on your database choice:
-
-m/--mongo: Add MongoDB configuration and files for the module. -
-s/--seque: Add Sequelize configuration and files for the module. -
-y/--yes: Skip interactive prompts and use default values for module creation.
Initialize Sequelize Structure
To set up Sequelize with default folders, files, and install necessary packages:
node-initdb --sequenode-initdb -sInitialize MongoDB Structure
To set up MongoDB with default folders, files, and install necessary packages:
node-initdb --mongo node-initdb -mAdd Module Task
To add a new module using node-add, run the following command:
node-add <moduleName> [-m / --mongo] [-s / --seque]Replace <moduleName> with the name of your module. Use the following optional flags:
Example
node-add "user" -mFolder Structure
After running the command, node-initdb will create the following folder structure:
- config/
- Controllers/
- Routes/
- Models/
- uploads/
- Utils/Files Created
node-initdb creates essential files such as controller, route, model files, and configuration files necessary for setting up your chosen database.
Dependencies
node-initdb installs the following dependencies based on your database setup:
- For Sequelize:
sequelize,mysql2 - For MongoDB:
mongoose - Middleware and Utilities:
express,body-parser,cors,dotenv,fs,http-errors,https,jsonwebtoken,multer
Contributing
Contributions are welcome! Fork the repository, make your changes, and submit a pull request. Please follow the existing coding style and guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Get in touch
If you have any questions, feel free to reach out:
- Email: ashrafchauhan567@gmail.com
- GitHub: @MohamedAshraf701
