Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

create-fastify-oop-decorators

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-fastify-oop-decorators

The official scaffolding CLI tool to quickly bootstrap a Fastify application using **[fastify-oop-decorators](https://github.com/WaRtr0/fastify-oop-decorators)**.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
8
300%
Maintainers
1
Weekly downloads
 
Created
Source

create-fastify-oop-decorators

The official scaffolding CLI tool to quickly bootstrap a Fastify application using fastify-oop-decorators.

Get a NestJS-like Developer Experience (DX) with the raw performance of Fastify in seconds.

Features

  • Interactive CLI: A smooth, interactive prompt to configure your project.
  • TypeScript Ready: Pre-configured tsconfig.json with strict mode, experimentalDecorators, and emitDecoratorMetadata.
  • Modular Architecture: Generates an enterprise-ready folder structure (Controllers, Services, Modules, and Plugins).
  • Validation Options: Choose between native Fastify JSON schemas or class-based DTOs via ajv-decorators.
  • Linter Support: Out-of-the-box configuration for ESLint or Biome.
  • Package Manager Agnostic: Works flawlessly with npm, pnpm, yarn, and bun.

Quick Start

The easiest way to get started is to use npx. Run the following command in your terminal:

npx create-fastify-oop-decorators@latest my-awesome-api

You will be prompted to choose your preferences:

  • Which package manager to use?
  • Would you like to use ajv-decorators for class-based DTO validation?
  • Which linter would you like to use (ESLint, Biome, or none)?

Once the setup is complete, navigate into your new project and start the development server:

cd my-awesome-api
npm run dev

Non-Interactive Mode (CLI Flags)

You can bypass the interactive prompts by passing command-line arguments. This is perfect for CI/CD environments or quick setups.

npx create-fastify-oop-decorators@latest my-api --use-pnpm --ajv --biome --yes

Available Options:

FlagDescription
--use-npmExplicitly use npm to install dependencies.
--use-pnpmExplicitly use pnpm to install dependencies.
--use-yarnExplicitly use yarn to install dependencies.
--use-bunExplicitly use bun to install dependencies.
--ajv / --no-ajvInclude (or exclude) ajv-decorators for DTO validation.
--eslintInitialize the project with an ESLint configuration.
--biomeInitialize the project with a Biome configuration.
--no-linterSkip linter configuration entirely.
--yesUse your previously saved preferences (or defaults) without prompting.
--reset-preferencesClear the saved preferences from your machine.

Generated Project Structure

By default, the CLI generates a modular, enterprise-ready architecture:

my-awesome-api/
├── src/
│   ├── hello/
│   │   ├── dto/
│   │   │   └── sayHelloPost.dto.ts  # (If ajv-decorators is enabled)
│   │   ├── hello.controller.ts      # Example Controller
│   │   ├── hello.module.ts          # Module grouping Controller & Service
│   │   └── hello.service.ts         # Example injectable Service
│   ├── plugins/
│   │   ├── ajv-decorators-plugin.ts # (If ajv-decorators is enabled)
│   │   └── bootstrap-plugin.ts      # Fastify OOP injection setup
│   ├── app.module.ts                # Root module
│   ├── build-app.ts                 # Fastify instance builder (Great for testing!)
│   └── index.ts                     # Entry point (Server listen)
├── package.json
├── tsconfig.json
└── eslint.config.mjs / biome.json   # Depending on your linter choice

Available Scripts

Inside your newly created project, you can run:

  • npm run dev: Starts the application in watch mode using tsx.
  • npm run build: Compiles the TypeScript code into the dist/ folder.
  • npm start: Runs the compiled application.
  • npm run lint: Runs your chosen linter (ESLint or Biome) to check your codebase.

License

This project is licensed under the MIT License.

FAQs

Package last updated on 01 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts