Pug-lexer is a core component of the Pug (formerly Jade) templating engine, responsible for tokenizing Pug code. It parses a Pug template string and breaks it down into a stream of tokens, representing elements, attributes, text, and control structures. These tokens are then used by the Pug parser to construct an abstract syntax tree (AST). Understanding pug-lexer is critical for debugging Pug templates or creating tools that process or analyze Pug code.
The pug-lexer npm package has seen sporadic releases since its initial versions in December 2015. Release frequency peaked in 2016, with consistent updates, then slowed considerably after 2017. There have been only a few releases since, with the last release being in February 2021. No releases have occurred in the past four plus years.
Pug-lexer downloads showed growth from March 2024 to June 2025, peaking at over 9 million. July 2025 remained high, followed by a drop in August. September 2025 data is incomplete, showing significantly lower downloads, likely due to it being only partially complete.