create-fastify

repository·main·Indexed 41 days ago

https://github.com/fastify/create-fastify

A scaffolding tool for rapidly generating new Fastify projects or integrating the Fastify project structure into existing ones. Version 5.0.1 provides a CLI wrapper around fastify-cli/generate and supports project initialization via npm init fastify.

Tokens
447
Snippets
3
Records
3
Agent score
0%

What's inside create-fastify

  1. Integrate Fastify into an existing project

    main

    If you already have a project and want to add the Fastify structure, use the --integrate flag.

    Warning: This mode will overwrite existing files. Ensure you have a backup or have committed your current changes before proceeding.

    Overwritten Files

    The following files and folders will be overwritten:

    • .gitignore
    • app.js
    • plugins/
    • routes/
    • test/

    Modified Files

    • package.json will be modified but not overwritten.

    Plugin Loading

    Plugins in the generated structure are loaded using @fastify/autoload with an empty default configuration.

    npm init fastify --integrate
  2. Generate a new Fastify project

    main

    You can rapidly scaffold a new Fastify project using npm init. You do not need to install the create-fastify package manually; npm init will locate and execute it automatically.

    Run the following command to start the scaffolding process, replacing [your_app_name] with your desired project name:

    npm init fastify [your_app_name]
  3. Use the create-fastify CLI

    main

    The create-fastify CLI is a generator used to scaffold new Fastify projects. It acts as a wrapper around fastify-cli/generate.

    By default, if no directory argument is provided, the generator scaffolds the project in the current directory (.). If you provide a path as the first argument, it will use that directory.

    Note: If the first argument starts with a hyphen (-), the CLI treats it as a flag and defaults the target directory to the current directory (.).

    # Scaffold in the current directory
    create-fastify
    
    # Scaffold in a specific directory
    create-fastify my-fastify-app