Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohamedashraf701/node-cli
NpmJs
https://github.com/mohamedashraf701/node-cli
Last synced: 2 months ago
JSON representation
NpmJs
- Host: GitHub
- URL: https://github.com/mohamedashraf701/node-cli
- Owner: MohamedAshraf701
- License: apache-2.0
- Created: 2024-05-09T19:12:26.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T22:45:56.000Z (6 months ago)
- Last Synced: 2024-10-10T06:01:13.230Z (2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-initdb
- Size: 1.68 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-initdb
node-initdb is a CLI tool for initializing database configurations and structures in Node.js projects.
![Node InitDB Plugin Demo](https://github.com/MohamedAshraf701/node-cli/blob/main/example.gif)
## Installation
You can install node-initdb globally using npm:
```bash
npm install -g node-initdb
```## Usage
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:
```bash
node-initdb --seque
``````bash
node-initdb -s
```### Initialize MongoDB Structure
To set up MongoDB with default folders, files, and install necessary packages:
```bash
node-initdb --mongo
``````bash
node-initdb -m
```### Add Module Task
To add a new module using `node-add`, run the following command:
```bash
node-add [-m / --mongo] [-s / --seque]
```Replace `` with the name of your module. Use the following optional flags:
### Example
```bash
node-add "user" -m
```## Folder 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](LICENSE) file for details.
## Get in touch
If you have any questions, feel free to reach out:
- Email: [email protected]
- GitHub: [@MohamedAshraf701](https://github.com/MohamedAshraf701)# Support