Point-of-view is a template rendering plugin for Fastify that decorates the reply interface with view methods for managing template engines.
The plugin solves the problem of rendering templated responses in Fastify applications by providing a unified interface to multiple template engines. It supports a wide range of engines including EJS, Nunjucks, Pug, Handlebars, Mustache, Twig, Liquid, doT, Eta, Edge, and Squirrelly. The approach works by decorating Fastify's reply object with `view` and `viewAsync` methods that handle template rendering. The tool automatically manages caching behavior based on environment: in production it heavily caches templates and compiled functions for performance, while in development it reloads templates on each request to support iterative development.
Developers should choose this plugin when building Fastify applications that need server-side template rendering. It suits projects requiring flexibility in template engine choice, as the same plugin interface works across multiple engines without requiring engine-specific code. The plugin is particularly relevant for applications where rendering performance matters, as benchmarks show Fastify with point-of-view achieves significantly higher request throughput than Express-based alternatives.
The project maintains active development with ongoing refinement of its API, as evidenced by the introduction of `viewAsync` as a replacement for the earlier `view` method and the removal of deprecated engine support like ejs-mate and marko to encourage users toward maintained alternatives. The codebase shows responsiveness to ecosystem changes by dropping support for unmaintained template engines while directing users to dedicated packages where appropriate.