Installation
This section lists the core packages of LiteMW and their installation methods.
Router
To get started, you only need two modules: koa and @litemw/router. This is sufficient for the examples from the previous step. For a more detailed description of the router, see the creating an application section.
npm install koa @litemw/routeryarn add koa @litemw/routerpnpm i koa @litemw/routerbun i koa @litemw/routerTIP
Optionally, you can also use @koa/router. @litemw/router uses it internally and delegates all its methods.
Middlewares
npm install @litemw/middlewaresyarn add @litemw/middlewarespnpm i @litemw/middlewaresbun i koa @litemw/middlewaresTo use the useBody and useFiles middlewares, you will need the koa-bodyparser.
npm install koa-bodyparseryarn add koa-bodyparserpnpm i koa-bodyparserbun i koa-bodyparserOptionally, for validation, you can use the zod or class-validator
npm install zodyarn add zodpnpm i zodbun i zodnpm install class-validatoryarn add class-validatorpnpm i class-validatorbun i class-validatorFor additional OpenAPI schema support with these libraries, you can use zod-openapi and class-validator-jsonschema
npm install zod-openapiyarn add zod-openapipnpm i zod-openapibun i zod-openapinpm install class-validator-jsonschemayarn add class-validator-jsonschemapnpm i class-validator-jsonschemabun i class-validator-jsonschemaOpenAPI
The OpenAPI module provides tools for generating OpenAPI schemas based on your routers, which can later be used, for example, with SwaggerUI.
npm install @litemw/openapiyarn add @litemw/openapipnpm i @litemw/openapibun i @litemw/openapi