generator-koa-esm-api v0.0.2
generator-koa-esm-api

Create Koa.js API server using the modern ESM Node.js module system + Mongoose
About
This generator uses ESM modules along with webpack + pkg to build a binary. The .env file used during development will be hardcoded in the resulting binary (however, consider encrypting sensitive data, because simple strings command can reveale all of your env variables). Also this generator uses the custom Node.js loader functionality to provide custom aliasing like @/lib/email, which is resolved by webpack during the build. \
NOTE: do not forget to add MONGODB_URI variable to .env file when goin prod.
Installation
First, install Yeoman and generator-koa-esm-api using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-koa-esm-apiThen generate your new project:
yo koa-esm-apiTo create a new route run:
yo koa-esm-api:route nameTo create a new model run:
yo koa-esm-api:model nameGetting To Know Yeoman
- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
License
GPL-3.0 © Seva D.