small-templater

small simple template engine

Usage no npm install needed!

<script type="module">
  import smallTemplater from 'https://cdn.skypack.dev/small-templater';
</script>

README

small-templater

Simple small template engine

Table of contents

Install

npm install small-templater

Usage

import { SmallTemplater } from "small-templater";

const smallTemplater: SmallTemplater = new SmallTemplater();

// for objects
smallTemplater.addEntity("foo", { bar: "baz" });
console.log(smallTemplater.parse("foo.bar is { foo.bar }"));

// for arrays
smallTemplater.addEntity("foo", { bar: ["baz"] });
console.log(smallTemplater.parse("foo[bar][0] is { foo[bar][0] }"));

See tests for more info.

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. </legalese>

License

Copyright (c) 2018, x-foby. (MIT License)

See LICENSE for more info.