@keleran/toolkit
v1.0.1
Published
Building blocks for Node.js web applications
Readme
This package is a merged, refactored, and extended continuation of @keleran/orm and @keleran/routing.
It provides a few essential building blocks for Node.js web applications:
- CodedError - an
Errorwith a mandatory code and optional metadata. - HttpError - a
CodedErrorwith a mandatory HTTP status code. - Db - query a PostgreSQL database using MongoDB-inspired syntax or raw SQL.
- Model - define business logic entities as classes, persist instances with
Db. - ModelLinker - simplify getting referenced model instances.
- RequestHandler - define Express request handler.
- RouterCodegen - organize routing using a file system directory tree.
Usage guidelines and examples can be found in the source code and test files.
While you're welcome to use this code in your own projects, the primary goal of publishing this package is to make it easier for the author to maintain his closed-source applications. This means that the code will remain highly opinionated, simplistic, and prone to sudden breaking changes.
