@basalt/twig-renderer
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.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
    composer install
    npm run setup

    Keywords

    Install

    npm i @basalt/twig-renderer

    DownloadsWeekly Downloads

    2,546

    Version

    2.1.0

    License

    MIT

    Unpacked Size

    2.54 MB

    Total Files

    757

    Last publish

    Collaborators

    • evanlovely
    • sghoweri
    • joekarasek