2022-07-24 13:30:19 +00:00
|
|
|
import * as plugins from './smarthbs.plugins.js';
|
2017-03-19 16:14:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get a template for a file on disk
|
|
|
|
*/
|
|
|
|
export let getTemplateForFile = async (filePathArg: string) => {
|
2018-08-27 21:04:15 +00:00
|
|
|
let filePathAbsolute = plugins.path.resolve(filePathArg);
|
|
|
|
return plugins.handlebars.compile(plugins.smartfile.fs.toStringSync(filePathAbsolute));
|
|
|
|
};
|
2017-05-26 13:16:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get a template for string
|
|
|
|
*/
|
|
|
|
export let getTemplateForString = async (fileStringArg: string) => {
|
2018-08-27 21:04:15 +00:00
|
|
|
return plugins.handlebars.compile(fileStringArg);
|
|
|
|
};
|