# @simtropolis/tpl

> ## Install

Latest version **0.1.21** (published 2023-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @simtropolis/tpl
pnpm add @simtropolis/tpl
yarn add @simtropolis/tpl
bun add @simtropolis/tpl
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.21 |
| Published | 2023-01-13 |
| First published | 2023-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Simtropolis |
| Maintainers | asvegah |

## Links

- npm: https://www.npmjs.com/package/@simtropolis/tpl
- Repository: https://github.com/Simtropolis/framework.git#main
- Homepage: https://github.com/Simtropolis/framework/tree/main#readme
- Issues: https://github.com/Simtropolis/framework/issues
- npm.io page: https://npm.io/package/@simtropolis/tpl

## Dependencies (1)

- [lodash.template](https://npm.io/package/lodash.template.md) ^4.5.0

## Recent versions

- 0.1.21 (latest) — 2023-01-13

## README

# Tpl

## Install

`npm install @simtropolis/tpl --save`

or

`yarn add @simtropolis/tpl`


## Usage

```
const tpl = require('@simtropolis/tpl');
messages = {
    myError: 'Something terrible happened to {something}'
};

console.error(tpl(messages.myError, {something: 'The thing'}));
```

* Takes strings like 'Your site is now available on {url}' and interpolates them with passed in data
* Will ignore double or triple braces like {{get}} or {{{content}}}
* Can handle escaped braces e.g. \\\\{\\\\{{helpername}\\\\}\\\\}
* There's a simple bare minimum escaping needed to make {{{helpername}}} work with interpolation e.g. {\\\\{{helpername}}}


## Develop

This is a mono repository, managed with [lerna](https://lernajs.io/).

Follow the instructions for the top-level repo.
1. `git clone` this repo & `cd` into it as usual
2. Run `yarn` to install top-level dependencies.


## Run

- `yarn dev`


## Test

- `yarn lint` run just eslint
- `yarn test` run lint and tests




# Copyright & License

Copyright (c) 2020-2022 Simtropolis - Released under the [MIT license](LICENSE).

---
_Source: https://npm.io/package/@simtropolis/tpl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
