npm

Need private packages and team management tools?Check out npm Orgs. »

@basalt/twig-renderer

0.12.0 • Public • Published

Twig Renderer

Greenkeeper badge

Render templates using Twig PHP, via this Node JS renderer.

Special thanks to Salem Ghoweri for collaboration on this project!

How to Use

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

npm install
npm run setup

Keywords

install

npm i @basalt/twig-renderer

Downloadsweekly downloads

611

version

0.12.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability