Skip to content

code-collabo/node-mongo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

@code-collabo/node-mongo-cli

All Contributors

npm version Npm package total downloads contributions welcome CLI license: AGPL 3.0 API boilerplate templates license: ISC GitHub issues GitHub pull requests

Supported node versions: node v12.x to v18.x

Operating Systems: Mac, Windows, and Linux OS

Parent repo: code-collabo/node-mongo

Latest info: The latest version of CLI generates API boilerplate templates v1.0.0

The node-mongo-cli is a Command Line Interface made with Node.js. It bootstraps any of the node-mongo API boilerplate templates for your nodejs mongoDB development, depending on your preference.

Features

node-mongo

CLI

  • CLI bootstraps the typescript, es module, or common js (a.k.a. ts, esm, cjs) templates for nodejs mongoDB development.
  • Install dependencies and initialize git for the template bootstrapped or choose to skip them.
  • Folders are automatically created based on user entry in the prompt or command line.
  • The default folder name is used and incremented if the folder name provided already exists.

API boilerplate templates

  • API boilerplate templates now use the MVC architecture pattern i.e. separated route, model, controller, and service files.
  • Development environment already set up with @babel (for esm template only), eslint, and server watch.
  • The default connection setup type is MongoDB Atlas. But you get to choose if you want to use it or switch to the Local mongoDB connection setup type.

CLI installation

Install CLI globally with this command:

npm install -g @code-collabo/node-mongo-cli

CLI command

After installing globally, use the node-mongo command.

node-mongo

Show CLI help

node-mongo --help

CLI usage

node-mongo <folder_name> <template>

CLI usage example

Replace <folder_name> with your preferred folder name. Replace <template> with any of these: ts, esm, or cjs. The example below will bootstrap the ts template i.e. the typescript template into a folder named test-folder.

node-mongo test-folder ts

CLI flags

-h, --help          Show help
-v, --version       Show version number
-i, --install       Install dependencies
-g, --git           Initialize git repo
-s, --skip-install  Skip installing dependencies
-x, --skip-git      Skip initializing git
-y, --yes           See note on --yes flag below

CLI prompts

If you do not specify one or both arguments above, you will be prompted to add your folder name and/or choose template option from list. For foldername, you can choose to use the default foldername provided in the prompt or type in your preferred folder name.

CLI skip prompts

No prompt when --yes flag is used. It skips both install and git init, and uses esm template as default if no template is specified or if template entered is not in the template collection. In the case of folder name, default foldername is used if no folder name is specified or when folder name already exists.

Documentation

See the links to the official documentation of the node-mongo project and community building it below:

Appreciation

Appreciation to @dkundel, @academind, @CodAffection, @coryhouse for the awesome helpful course resources they create, and to @jiobiagba and @IsraelObiagba for their occasional but mighty contributions.


Dominik Kundel

πŸ§‘β€πŸ«

Academind

πŸ§‘β€πŸ«

CodAffection

πŸ§‘β€πŸ«

Cory House

πŸ§‘β€πŸ«

Israel Obiagba

πŸ§‘β€πŸ«

Joseph Obiagba

πŸ§‘β€πŸ«

Contributors ✨

Thanks to these amazing contributors to the node-mongo-cli project. This project follows the all-contributors specification. See emoji key. Contributions of any kind welcome!

Abhishek K M
Abhishek K M

πŸ“–
All Contributors
All Contributors

πŸš‡
Chikezie Joachim
Chikezie Joachim

πŸ’»
David Oladepo
David Oladepo

πŸ“–
Hritik R
Hritik R

πŸ“– πŸ’»
Keithan Philander
Keithan Philander

πŸ› πŸ’»
Muhammad Izhar
Muhammad Izhar

πŸ“–
Obiagba Mary Ifeoma
Obiagba Mary Ifeoma

πŸ’» πŸ“–
Obiagba Samuel
Obiagba Samuel

πŸ’» πŸ›
Olaleye Blessing
Olaleye Blessing

πŸ“–
Rashid
Rashid

πŸ’»