SkillByAIOpen interactive version →

Lesson 2 / 32

Installation & Setup

Install Fastify, enable ES modules and set up an optional TypeScript toolchain for a new API project.

npm install fastify

Start with a Node project, then add Fastify as a dependency.

mkdir my-fastify-api && cd my-fastify-api
npm init -y
npm install fastify

Enable ESM

Add "type": "module" to package.json to use modern ES6 imports instead of CommonJS.

TypeScript support (optional)

Fastify has excellent TypeScript support out of the box.

npm install --save-dev typescript ts-node @types/node