Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knapsack-cloud/twig-renderer
Render templates using Twig PHP, via this Node JS renderer.
https://github.com/knapsack-cloud/twig-renderer
Last synced: 3 months ago
JSON representation
Render templates using Twig PHP, via this Node JS renderer.
- Host: GitHub
- URL: https://github.com/knapsack-cloud/twig-renderer
- Owner: knapsack-cloud
- Created: 2018-07-03T00:33:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-11T18:03:38.000Z (about 1 year ago)
- Last Synced: 2024-05-21T11:24:28.436Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.8 MB
- Stars: 11
- Watchers: 3
- Forks: 9
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- component-based-theming - twig-renderer
README
# Twig Renderer
[![Greenkeeper badge](https://badges.greenkeeper.io/basaltinc/twig-renderer.svg)](https://greenkeeper.io/)
> Render templates using Twig PHP, via this Node JS renderer.
*Special thanks to [Salem Ghoweri](https://twitter.com/salem_ghoweri) for collaboration on this project!*
# How to Use
```bash
npm install --save @basalt/twig-renderer
``````
const TwigRenderer = require('@basalt/twig-renderer');const config = {
// see `./config.schema.js` for details
};const twigRenderer = new TwigRenderer(config);
twigRenderer.render('@components/card.twig', { title: 'hi' }).then(results => {
if (results.ok) {
console.log(results.html);
} else {
console.log(results.message);
}
});
```Looking in tests folder can help.
# How to Develop
```bash
npm install
composer install
npm run setup
```