small-templater
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i small-templater

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.98 kB

Total Files

10

Last publish

Collaborators

  • x-foby