generator-koa-esm-api

0.0.2 • Public • Published

generator-koa-esm-api NPM version Coverage percentage

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-api

Then generate your new project:

yo koa-esm-api

To create a new route run:

yo koa-esm-api:route name

To create a new model run:

yo koa-esm-api:model name

Getting 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.

Package Sidebar

Install

npm i generator-koa-esm-api

Weekly Downloads

23

Version

0.0.2

License

GPL-3.0

Unpacked Size

63.4 kB

Total Files

34

Last publish

Collaborators

  • vaguuue