@optimumenergyco/koa-utilities
v0.4.1
Published
A collection of shared Node.js utilities
Downloads
12
Readme
Koa Utilities
This repository is a collection of shared Node.js modules for use internal use at Optimum Energy. Currently, the package exports the following components:
logger
: A generic Winston logger preconfigured to output to the console.requestIdMiddleware
: A Koa middleware that automatically appends a request ID to the header if it's not already present.errorMiddleware
: A Koa middleware that sets a response when an error occurs in the application.requestLoggerMiddleware
: A Koa middleware that automatically logs requests and responses.validationMiddleware
: A Koa middleware that validates incoming openAPI schema, requests and responses.DatabaseError
: A generic database error.ValidationError
: A generic validation error.NotFoundError
: A generic not found error.
Deployment
The koa-utilities
package is automatically deployed by the CI server. If you'd like for your
changes to be deployed to NPM, you must first set the new version manually. Be sure to follow
semantic versioning.
yarn version
Next, you'll need to push up your changes to GitHub along with the versioned tag created by Yarn.
git push origin HEAD
git push --tags origin HEAD
All of this should happen after your PR has been approved but before your changes are merged into master .
Finally, after you've merged your branch into master, check on NPM to make sure the new version of the package is the same as the version you just set. Note that even after the merge to master build runs successfully, it may take some time to be reflected up on NPM.