# Fastify

MIT\-licensed Node\.js HTTP framework with encapsulated plugins, schema validation, response serialization and request\-injection testing\.

ID: Q1170 · Revision: 1218

Type: software · License: MIT[^license] · Status: active

Website: https://fastify.dev



Fastify is an open\-source web framework for Node\.js\. It combines HTTP routes with a plugin system, lifecycle hooks, request validation and response serialization\. Its encapsulation model allows different parts of an application to receive different hooks and utilities\. This makes it a building block for a custom backend rather than a complete hosted backend product\.[^intro][^encapsulation][^validation]

## Capabilities and substitutions

### Scoped plugins and hooks — supported

Encapsulation determines which decorations, hooks and plugins are visible to routes; child changes do not automatically propagate to parents\.[^encapsulation]

Use case: Building and testing Node\.js HTTP APIs · Platforms: Supported Node\.js release lines · Region: Version, build and integration requirements apply

### Schema validation and serialization — supported

JSON Schema feeds request validation and output serialization; schemas must be trusted application code\.[^validation]

Use case: Building and testing Node\.js HTTP APIs · Platforms: Supported Node\.js release lines · Region: Version, build and integration requirements apply

### Arbitrary untrusted schema compilation — unsupported

Documentation warns that new Function\-based compilation is unsafe for user\-provided schemas\.[^validation]

Use case: Building and testing Node\.js HTTP APIs · Platforms: Supported Node\.js release lines · Region: Version, build and integration requirements apply

### Request\-injection tests — supported

inject simulates HTTP requests after registered plugins have booted; tests can inspect responses without starting a listening server\.[^testing]

Use case: Building and testing Node\.js HTTP APIs · Platforms: Supported Node\.js release lines · Region: Version, build and integration requirements apply

### Existing middleware compatibility — limited

Express\-style middleware requires an external plugin and operates on raw Node objects before Fastify Request/Reply wrapping\.[^middleware]

Use case: Building and testing Node\.js HTTP APIs · Platforms: Supported Node\.js release lines · Region: Version, build and integration requirements apply

### [Substitute for Hono](/hono) — limited

Can replace Hono for a Node\.js API after rewriting handlers and middleware around Fastify's lifecycle\. It does not establish Hono\-style Web Standards portability or compatibility with Hono's typed client\.[^intro][^middleware][^hono]

Use case: Building and testing Node\.js HTTP APIs · Platforms: Supported Node\.js release lines · Region: Version, build and integration requirements apply

## References

[^license]: [Fastify license](<https://github.com/fastify/fastify/blob/main/LICENSE>) — MIT conditions (vendor; retrieved 2026-10-07T23:00:26Z)

[^intro]: [Fastify documentation](<https://fastify.dev/docs/latest/>) — Framework identity and documentation structure (vendor; retrieved 2026-10-07T23:01:01Z)

[^encapsulation]: [Fastify encapsulation](<https://fastify.dev/docs/latest/Reference/Encapsulation/>) — Context inheritance and plugin completion (vendor; retrieved 2026-10-07T23:00:41Z)

[^validation]: [Fastify validation and serialization](<https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/>) — Schema compilation, trusted\-schema warning and async validation caution (vendor; retrieved 2026-10-07T23:00:26Z)

[^migration]: [Fastify v5 migration guide](<https://fastify.dev/docs/latest/Guides/Migration-Guide-V5/>) — Node baseline, full JSON Schema and changed APIs (vendor; retrieved 2026-10-07T23:00:26Z)

[^middleware]: [Fastify middleware](<https://fastify.dev/docs/latest/Reference/Middleware/>) — External middleware plugins, raw Node objects and hook alternative (vendor; retrieved 2026-10-07T23:01:01Z)

[^testing]: [Fastify testing guide](<https://fastify.dev/docs/latest/Guides/Testing/>) — Separating application/server and inject plugin readiness (vendor; retrieved 2026-10-07T23:00:51Z)

[^support]: [Fastify LTS policy](<https://fastify.dev/docs/latest/Reference/LTS/>) — Supported runtime lines and security\-release compatibility caveat (vendor; retrieved 2026-10-07T23:01:01Z)

[^hono]: [Hono framework overview](<https://hono.dev/docs>) — Web Standards and multi\-runtime model (vendor; retrieved 2026-10-07T23:00:05Z)

Source revision: https://substitutefor.net/entities/Q1170?revision=1218
