Disane87 / docudigger

Website scraper for getting invoices automagically as pdf (useful for taxes or DMS)

Home Page:https://blog.disane.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File name should be able to be changed by the user with template variables

Disane87 opened this issue · comments

Currently the filename is fixed. This should be changed toi enable the user to set the filename by his needs.

We don't need any template library, we can achieve this by typescript only:

let stringWithVars = (str, obj) => str.replace(/\${(.*?)}/g, (x,g)=> obj[g]);

But this only applies when there is no computation or advanced formatting needed. Everything else needs a template engine like Handlebars or somethign else.

What do you think @fwartner?