npm / pug
pug
What changed in pug 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-27.
2 breaking3 new APIs and options1 behavior and defaults1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpug 37 changes
Breaking changes 2
The minify option on filters now requires installing the relevant jstransformer.
Support for Node.js 6 and 8 has been dropped.
New APIs and options 3
Pug supports each ... of ... loops, including iteration over Maps, Sets, and arrays.
A plugin can replace code generation using generateCode.
Filters can use a renderBuffer property to process Buffer input.
Behavior and default changes 1
Read plugins must return Buffer to support filters that use renderBuffer; returning string remains supported otherwise.
Fixes and other changes 1
The doctype option is now properly validated.