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 install fastify
yarn add fastify
pnpm add fastify
Import
import Fastify from 'fastify';
Quick Example
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
| Package | fastify |
| Category | Framework |
| Weekly Downloads | 3M+ |
| License | MIT |
| Install | npm install fastify |
Related Packages
Express is the most widely used web application framework for Node.js, providing a minimal and flexi…
Hono is an ultrafast, lightweight web framework designed to run on any JavaScript runtime including …
Koa is a lightweight web framework for Node.js created by the same team behind Express. It was desig…
Hapi (originally Happy.js) is a rich framework for building applications and services on Node.js, cr…
NestJS is a progressive Node.js framework for building efficient, reliable, and scalable server-side…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.