1.0.9 • Published 2 years ago

text-import-engine v1.0.9

Weekly downloads
-
License
GNU GPLv3
Repository
-
Last release
2 years ago

Text Import Engine

Purpose

TIE is a barebones text templating engine. It was originally intended to be used to render server-side html templates; however it can easily be utilised to create templates for any markup, programming, or plain language with the power of dynamic javascript.

Getting Started

To start using TIE in your project simply install with npm i text-import-engine and import the module import Tie from "text-import-engine".

Usage

TIE as of now has one function Tie.render(string, object) it takes two arguments: the first being the string to be modified, and second being an object containing the data TIE should use to modify the aforementioned string. The syntax to show TIE where in the text these modifications should take place is simple |o| example |o| where 'example' is a key in the data object.

Examples

Using TIE syntax within a string

<p>hello |o| name |o| nice to see you again</p>

Creating a data object

const data = {name: 'jordan'}

Calling TIE's render function

Tie.render('<p>hello |o| name |o| nice to see you again</p>', data) returns: <p>hello jordan nice to see you again</p>

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago