transform-template
v1.2.2
Published
Template transformer
Downloads
2
Readme
Description
Convert template files
Installation
npm install transform-template
Usage
const {transformTemplate} = require("transform-template");
Examples
Convert a string
const {transformTemplateString} = require("transform-template");
const str = `const someFunction = function () { const aa = "##aaaa##"; }`
const content = transformTemplateString(str, {aaaa: "Salut"});
Convert a file
transformTemplateFiles("../demo/file1.js", {aaaa: "Hi you!"}, {});
Convert a directory
transformTemplateFiles("../demo/", {aaaa: "Hi you!"});
Package
📁 package
│
└───📁 cjs
│ │
│ └─📝 index.cjs ⇽ CJS version - Browser (4.3kB unminified)