1.0.0 • Published 6 years ago

small-templater v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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.