nestjs-console

A NestJS module that provide a cli

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
nestjs-console
54079.0.010 months ago5 years agoMinified + gzip package size for nestjs-console in KB

Readme


nestjs-consolenpm is a module that provide a cli. A ready to use service class for your modules that exposes methods to register commands and sub commands using the npm package commandercommander

Why

The nestjs framework is missing a cli to access the application context.
Common use case : Headless application, cront task, export data, etc... nestjs-consolenpm provide a way to bind cli command and subcommands to providers's methods.

How it works

The console service works as a standalone process, like the classic entry point, and will initialize a NestApplicationContext (headless) instead a NestApplication. The console service will be accessible inside the container.
  1. Bootstrap (entry point e.g console.ts) is invoked by cli.
  2. Create a headless nest app, any module inside the app can create command and subcommands using nestjs-console with commandercommander
  3. nestjs-console invoke commander
  4. commander will do the rest.
Documentation