innoc-sdk
v0.0.5
Published
This is *INNOC SDK*, containing shared code used for all Innocuous Labs Node.js projects.
Downloads
35
Readme
INNOC SDK
This is INNOC SDK, containing shared code used for all Innocuous Labs Node.js projects.
Components
/controllers
This section of the SDK establishes a shared controller infrastructure for Node.js MVC. A base interface sets up a shared contract that all INNOC SDK base controllers will fulfill. This includes between two and six type parameters to establish the shape of your API responses and requests, session data, and user data.
Schema validation is codified with Zod. Providing a Zod schema corresponding to the shape of your object will grant better type security and provide type-validated API responses out of the box. Depending on the base class you are choosing to extend, there are likely to be a number of abstract properties and methods you will need to override in your own derived controller.
MongoBaseController
/env
This section of the SDK provides a toolkit for processing environment variables and making them available to applications.
It uses Zod for schema validation - this enables improved type security during development. This proves to be much less
error-prone than direct access (process.env.API_SECRT).
