Framework3M+/wkMIT

fastify

Fastify is a high-performance web framework for Node.js designed to be the fastest HTTP framework available while maintaining a great developer experience. It a

Installation

npm
npm install fastify
yarn
yarn add fastify
pnpm
pnpm add fastify

Import

ESM
import Fastify from 'fastify';

Quick Example

usage
const fastify = Fastify({ logger: true });

fastify.get('/', async (request, reply) => {
  return { hello: 'world' };
});

await fastify.listen({ port: 3000 });

About fastify

Fastify is a high-performance web framework for Node.js designed to be the fastest HTTP framework available while maintaining a great developer experience. It achieves exceptional throughput by using a schema-based approach to request and response validation and serialization powered by fast-json-stringify. Fastify features a powerful plugin architecture that allows full encapsulation of functionality, making it easy to split applications into decoupled, reusable modules. The framework provides built-in support for JSON Schema validation, automatic Swagger/OpenAPI documentation generation, lifecycle hooks, content type parsing, and decorators for extending request and reply objects. Fastify supports both async/await and callback-style handlers and includes a comprehensive TypeScript type system. It consistently benchmarks 2-3x faster than Express for JSON serialization workloads. The framework is backed by the OpenJS Foundation and has a growing ecosystem of official and community plugins covering common needs like authentication, CORS, rate limiting, and database integration.

Quick Facts

Packagefastify
CategoryFramework
Weekly Downloads3M+
LicenseMIT
Installnpm install fastify

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.