Skip to content

template

Replace data by name in template strings. The default expression looks for `{{name}}` to identify names.

Usage

template("Hello, {{name}}", { name: "world" }); // "Hello, world"
template("Hello, <name>", { name: "world" }, /<(.+?)>/g); // "Hello, world"

Installation

Terminal window
npx atmx add helper template