BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Fastify Node.js Web Framework

Fastify Node.js Web Framework

Fastify is an open-source Node.js web framework that remains focused on providing excellent developer experience, minimal performance overhead, and a flexible plugin architecture.

Fastify's development efforts are focused on six main features and principles. First, as its name suggests, Fastify is focused on speed, and can currently serve up to 30,000 requests per second.

Fastify provides extensibility via hooks, plugins, and decorators.

The Fastify project strongly recommends the option of using JSON Schema to validate routes and serialize outputs to improve performance and accuracy.

Fastify leverages Pino, a very low overhead Node.js logger, for logging.

Fastify strives to be friendly for developers, with a focus on expressive code without sacrificing performance and security.

While not a TypeScript framework, Fastify is TypeScript-ready with full support for TypeScript type definitions.

Getting started with Fastify requires installation via npm:

npm install fastify

Fastify then provides APIs for working with routes, running the server, request/response validation and hooks, lifecycle management, middleware, error handling, content parsing, and much more.

The Fastify ecosystem has more than 100 core and community plugins supporting a wide range of features.

Fastify Performance benchmarks exist comparing Fastify to Koa, Express, Restify, and Hapi. 

Fastify is open source software available under the MIT license and is part of the OpenJS Foundation. Contributions are welcome and should follow the Fastify contribution guidelines and code of conduct.

Rate this Article

Adoption
Style

BT