art-template is a high-performance JavaScript template engine designed for both Node.js and browser environments. It achieves near-JavaScript-limit rendering speeds through a 'scope pre-declared' optimization technique. The current stable version is 4.13.4, with a release cadence that addresses bugs, performance, and adds minor features, as seen in recent patch and minor releases (e.g., v4.13.0 for performance fixes, v4.13.2 for type definitions). Key differentiators include its extreme speed, debugging friendliness (accurate error positioning, breakpoint support with Webpack loader), support for template inheritance, sub-templates, and a small browser footprint (6KB). It integrates with popular frameworks like Express and Koa, and build tools like Webpack.
npm install art-templateVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up `art-template` with global defaults, register custom filters, compile a template string, and render it with provided data. It showcases basic templating features like variable output, looping, conditionals, and raw HTML output.
Update template files to use standard JavaScript expressions for helper calls, as the v3 `{{helper args}}` syntax is deprecated. For example, change `{{helper args}}` to `{{ helper.func(args) }}`.If you relied on template errors being suppressed or handled differently, explicitly set `template.defaults.bail = false;` to revert to previous behavior or implement custom error handling.
Ensure you are using `art-template` version `4.13.2` or higher to have the correct TypeScript definition files included in the package.
Upgrade to `art-template` version `4.13.1` or newer to resolve issues related to `window` being undefined in specific runtime contexts.
Upgrade to `art-template@4.13.1` or higher to resolve the issue.
Refactor template helper calls to use standard JavaScript expression syntax, e.g., `{{ helper.someHelper(args) }}` or `{{ someGlobalFunction(args) }}`.Upgrade `art-template` to version `4.13.2` or newer to ensure correct type definitions are included in your project.
No dependency data recorded yet.