# twigjs/twig.js

JS implementation of the Twig Templating Language

Repository: https://github.com/twigjs/twig.js
Canonical: https://ross.abutalabs.com/products/twigjs
Language: JavaScript
License: BSD-2-Clause
License Family: permissive
Topics: twig, twigjs
Last push: 2026-08-18T15:47:54+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 76, longevity 100
- inputs: {"age_days": 5441, "days_push": 15, "days_rel": 160, "gap_med": 17, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1933, forks 282 (observed 2026-08-28T04:05:56.310967+00:00)

## What it is
Twig.js is a pure JavaScript implementation of the Twig PHP templating language, usable in both browsers and Node.js. It supports a subset of Twig syntax and integrates with Express as a view engine.

## Use cases
- render twig templates in node.js
- use twig as an express view engine
- render templates in the browser
- share twig templates between php and javascript apps
- compile twig template files to html

## When to choose
- you need Twig syntax in a JavaScript environment
- you're building an Express app and prefer Twig templates
- you want browser and server-side rendering with the same template language

## When to avoid
- you need full Twig PHP feature parity, since only a subset is supported
- you prefer modern JS templating like Handlebars, EJS, or React components

## Facets
- artifact type: library
- maturity: active
- function: templating, web-framework
- domain: web-development, frontend, backend
- platform: browser, cross-platform
- tags: twig, template-engine, javascript, express, nodejs

## Member repositories
- twigjs/twig.js (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:56.310967+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:08:39.947018+00:00, confidence not recorded.
  - readme: https://github.com/twigjs/twig.js (fetched 2026-08-28T04:05:56.310967+00:00, sha 46d45b6e9030)
- Data as of 2026-08-30T08:39:29.467469+00:00.
