JSPM

  • Created
  • Published
  • Downloads 464334
  • Score
    100M100P100Q192428F

JS port of the Twig templating language.

Package Exports

  • twig
  • twig/twig

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (twig) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

About

Twig.js is a pure JavaScript implementation of the Twig PHP templating language (http://twig.sensiolabs.org/)

The goal is to provide a library that is compatable with both browsers and node.js.

Twig.js is currently a work in progress and supports a limited subset of the Twig templating language (with more coming).

Supported tags:

  • if / elseif / else / endif
  • for / else / endfor
  • set

Filters are not yet supported, but most of the expression syntax is implemented.

Usage

Documentation is available in the twig.js wiki

License

Twig.js is available under the BSD 2-clause license http://www.opensource.org/licenses/BSD-2-Clause

See the LICENSE file for details

Acknowledgments

The fills for Array.forEach and Array.indexOf in src/twig.fills.js are from https://developer.mozilla.org/ and used under a Creative Commons Attribution-ShareAlike 2.5 License