Skip to content

Add Command

The lts add (or a) command supercharges your LightTs project by integrating features like JWT authentication, validation, CORS, or database support. Each feature generates clean, customizable Node.js code using standard libraries for maximum flexibility.

Terminal window
lts add <feature>
lts a <feature>
  1. Choose a Feature: Pick jwt, validation, cors, or database.
  2. Run the Command: Use lts add <feature> to generate the necessary files.
  3. Customize: Tweak the generated code to fit your needs.

JWT Authentication

Add token-based authentication with jsonwebtoken.

Terminal window
lts add jwt

Validation

Enable schema-based validation with joi.

Terminal window
lts add validation

CORS

Allow cross-origin requests for your API.

Terminal window
lts add cors

Database

Integrate TypeORM for PostgreSQL, MySQL, MariaDB, or MongoDB.

Terminal window
lts add database