How to create a Twig JS function?

366 Views Asked by At

I'm using twig js template for node js 13.6.0 with express 3

I used before twig for php and since i passed on twig js i'm searching how to create a function that I can use inside my twig code in php it was :

> $twig->addFunction(new Twig_SimpleFunction("name", function(){
      //code
  }));

Do someone know how to create a twig js function??

Thanks

0

There are 0 best solutions below