npm install -g exspresso-clior
npx exspresso-cli init
- To start using exspresso-cli run
npx exspresso-cli initif you do not have it installed globally or
exspresso-cli initand follow the prompts.
- Fast and easy Express JS setup.
- Supports MongoDB and Mongoose
- Supports Postgresql using Sequelize-Cli
Easily spin up Express servers by selecting your preferred database dialect, currently only supports
Exspresso-cli will create folders and files according to the options selected. Postgresql schema's only support es5 at this time, but you can still select es6 in the options.
The poject folder will be created in your current working directory.
You can use the
npx exspresso-cli --help command to view available commands.
npx exspresso-cli -c <ControllerName>
Running the above command will generate a controller file with the
Controller Name parameter. Methods are already provided for basic queries, but you can add your own.
Generating Models (MongoDB Only)
npx exspresso-cli -m <ModelName> key:datatype,anotherKey:datatype
-m will allow you to generate a model file. Ideally the
<ModelName> should be singular.
npx exspresso-cli -m User key:datatype,anotherKey:datatype
The datatypes are all mongoose datatypes and follow the same naming convention such as
String. The key's and datatypes are interpreted as comma seperated
You can generate models using the
sequelize-cli commands. There was no need to abstract another layer over the existing commands.
Controllers can be generated for a Postgres build using the controller command.
To contribute to this project read Here
- 1/9/2020 - Fixed a bug in Postgres based projects where the controller command would navigate to non existing
srcdirectory. Updated mongoose based models to use
modelnameModelnaming convention. Made project initialize more efficient using an asynchronous method instead of