PHPackages                             ecentria/twig-js - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. ecentria/twig-js

ActiveLibrary[Templating &amp; Views](/categories/templating)

ecentria/twig-js
================

twig.js, flexible, secure, and high-performance templating engine for Javascript

1.0.2(11y ago)07Apache2PHP &gt;=5.3.2

Since Jun 23Pushed 5y agoCompare

[ Source](https://github.com/ecentria/twig.js)[ Packagist](https://packagist.org/packages/ecentria/twig-js)[ RSS](/packages/ecentria-twig-js/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (12)Used By (0)

Twig.js
=======

[](#twigjs)

\[[![Build Badge](https://camo.githubusercontent.com/d2e12aa3d5789ffdda4cb69e7e5f8ff19031beb17898a730c24f6dd3ded18ac1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7363686d6974746a6f682f747769672e6a732e706e67)](https://camo.githubusercontent.com/d2e12aa3d5789ffdda4cb69e7e5f8ff19031beb17898a730c24f6dd3ded18ac1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7363686d6974746a6f682f747769672e6a732e706e67)\] [Build Status](http://travis-ci.org/schmittjoh/twig.js)\[[![Scrutinizer Badge](https://camo.githubusercontent.com/dfcf30e6d458c4a65c2c2ab27dd6ca5688481307352e5d3fd5a399db597e2c00/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6832732f747769672e6a732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://camo.githubusercontent.com/dfcf30e6d458c4a65c2c2ab27dd6ca5688481307352e5d3fd5a399db597e2c00/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6832732f747769672e6a732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)\] [Scrutinizer Code Quality](https://scrutinizer-ci.com/g/h2s/twig.js/?branch=master)

[Twig.js](http://jmsyst.com/libs/twig.js) is a PHP project that compiles Twig templates into executable Javascript for client-side execution. It is not to be confused with [Twig.js](https://github.com/justjohn/twig.js/), which is a pure Javascript implementation of the Twig templating language.

Twig Compatibility
------------------

[](#twig-compatibility)

Compatibility with vanilla PHP Twig is not yet at 100%. If you need your templates to work with both Twig.js *and* Twig, stick to the supported filters and functions described below.

#### Supported Filters

[](#supported-filters)

- `abs`
- `batch`
- `capitalize`
- `default`
- `e`
- `escape`
- `first`
- `join`
- `json_encode`
- `keys`
- `last`
- `length`
- `lower`
- `merge`
- `nl2br`
- `raw`
- `replace`
- `reverse`
- `title`
- `trim`
- `upper`
- `url_encode`

#### Supported Functions

[](#supported-functions)

- `block`
- `include`
- `max`
- `min`
- `random`
- `range`

Incompatibilities
-----------------

[](#incompatibilities)

The following is a list of functionality present in Twig that is not yet available in Twig.js. There are some really easy pickings in these lists for anybody hoping to make a contribution to the project.

#### Unsupported Filters

[](#unsupported-filters)

- `convert_encoding`
- `date` (See [pull request #11](https://github.com/schmittjoh/twig.js/pull/11))
- `date_modify`
- `format`
- `number_format`
- `round`
- `slice`
- `sort`
- `split`
- `striptags`

#### Unsupported Functions

[](#unsupported-functions)

- `attribute`
- `constant`
- `cycle`
- `date` (See [pull request #11](https://github.com/schmittjoh/twig.js/pull/11))
- `dump`
- `parent`
- `source`
- `template_from_string`

Testing
-------

[](#testing)

To run the tests, you'll need [Composer](https://getcomposer.org/), [Node](http://nodejs.org/) and [NPM](https://www.npmjs.org/) on your system.

```
$ make test
```

License
-------

[](#license)

Twig.js is released under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0), Version 2.0.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 67.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~160 days

Total

3

Last Release

4024d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3f4d63db210914aae4db410973aad191db25e2f2f9e175bf21952e32a978068?d=identicon)[EcentriaDev](/maintainers/EcentriaDev)

---

Top Contributors

[![schmittjoh](https://avatars.githubusercontent.com/u/197017?v=4)](https://github.com/schmittjoh "schmittjoh (45 commits)")[![jonathaningram](https://avatars.githubusercontent.com/u/626664?v=4)](https://github.com/jonathaningram "jonathaningram (6 commits)")[![julesbou](https://avatars.githubusercontent.com/u/328303?v=4)](https://github.com/julesbou "julesbou (3 commits)")[![fran6co](https://avatars.githubusercontent.com/u/726088?v=4)](https://github.com/fran6co "fran6co (3 commits)")[![kimlai](https://avatars.githubusercontent.com/u/1673880?v=4)](https://github.com/kimlai "kimlai (2 commits)")[![Josiah](https://avatars.githubusercontent.com/u/77621?v=4)](https://github.com/Josiah "Josiah (1 commits)")[![jstuhli](https://avatars.githubusercontent.com/u/1474280?v=4)](https://github.com/jstuhli "jstuhli (1 commits)")[![anod](https://avatars.githubusercontent.com/u/171704?v=4)](https://github.com/anod "anod (1 commits)")[![stefk](https://avatars.githubusercontent.com/u/880921?v=4)](https://github.com/stefk "stefk (1 commits)")[![br0wn](https://avatars.githubusercontent.com/u/1023589?v=4)](https://github.com/br0wn "br0wn (1 commits)")[![DerManoMann](https://avatars.githubusercontent.com/u/47783?v=4)](https://github.com/DerManoMann "DerManoMann (1 commits)")[![fduch](https://avatars.githubusercontent.com/u/1204137?v=4)](https://github.com/fduch "fduch (1 commits)")[![jeremyFreeAgent](https://avatars.githubusercontent.com/u/176363?v=4)](https://github.com/jeremyFreeAgent "jeremyFreeAgent (1 commits)")

---

Tags

templating

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ecentria-twig-js/health.svg)

```
[![Health](https://phpackages.com/badges/ecentria-twig-js/health.svg)](https://phpackages.com/packages/ecentria-twig-js)
```

###  Alternatives

[timber/timber

Create WordPress themes with beautiful OOP code and the Twig Template Engine

5.7k3.4M111](/packages/timber-timber)[jasny/twig-extensions

A set of useful Twig filters

10710.2M8](/packages/jasny-twig-extensions)[jms/twig-js

twig.js, flexible, secure, and high-performance templating engine for Javascript

360389.6k5](/packages/jms-twig-js)[goetas/twital

PHP templating engine that combines Twig and PHPTal power points

12813.1k1](/packages/goetas-twital)[goetas/twital-bundle

Twital templating engine Symfony Bundle

206.8k](/packages/goetas-twital-bundle)[tommcdo/kohana-twig

Kohana 3.3 module for the popular Twig template engine

241.9k](/packages/tommcdo-kohana-twig)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
