mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-29 11:19:08 +00:00
FEAT: pii
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { readFileSync } from 'fs';
|
||||
import Handlebars from 'handlebars';
|
||||
|
||||
export class HtmlParser<T> {
|
||||
constructor(private readonly templatePath: string) {}
|
||||
parse(data: T[]) {
|
||||
const templateSource = readFileSync(this.templatePath, 'utf8');
|
||||
|
||||
const template = Handlebars.compile(templateSource);
|
||||
|
||||
return template({
|
||||
dados: data,
|
||||
dataGeracao: new Date().toLocaleString('pt-BR'),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user