# @tryghost/tpl

Latest version **2.3.22** (published 2026-11-12) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.3.22 |
| Published | 2026-11-12 |
| First published | 2021-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 37 |
| Author | Ghost Foundation |
| Maintainers | zimoatghost, allouis, kernalghost, chrisraible, erisds, johnonolan, kevinansfield, cobbspur, aileencgn, jloh, minimaluminium, sam-lord, pauladamdavis, bobvaneck, joeegrigg, hadret, erik-ghost, sagzy, vershwal, zach1618, mike182uk, luissazevedo, lsinger, nickmoreton, renatoworks, rblstr-ghost, evanhahn-ghost, austin.burdine, fosxsters, foxsters, afeinsod, weylandswart, louisghost, ghost-slimer, tmciesco, jonatan-ghost, 9larsons |

## Links

- npm: https://www.npmjs.com/package/@tryghost/tpl
- Repository: https://github.com/TryGhost/framework
- npm.io page: https://npm.io/package/@tryghost/tpl

## Recent versions

- 2.3.22 (latest) — 2026-11-12
- 2.3.21 — 2026-11-11
- 2.3.20 — 2026-11-09
- 2.3.19 — 2026-11-02
- 2.3.18 — 2026-10-14
- 2.3.17 — 2026-10-14
- 2.3.16 — 2026-10-01
- 2.3.15 — 2026-09-30
- 2.3.14 — 2026-09-11
- 2.3.13 — 2026-09-03
- 2.3.12 — 2026-09-01
- 2.3.11 — 2026-09-01
- 2.3.10 — 2026-08-26
- 2.3.9 — 2026-08-20
- 2.3.8 — 2026-08-17
- … 62 more at https://npm.io/package/@tryghost/tpl/versions

## README

# Tpl

## Install

`npm install @tryghost/tpl --save`

or

`pnpm add @tryghost/tpl`

## Purpose

String templating helper for replacing `{token}` placeholders with runtime values.

## Usage

```
const tpl = require('@tryghost/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 [Nx](https://nx.dev).

Follow the instructions for the top-level repo.

1. `git clone` this repo & `cd` into it as usual
2. Run `pnpm install` to install top-level dependencies.

## Run

- `pnpm dev`

## Test

- `pnpm lint` runs oxlint
- `pnpm test` runs lint and tests

# Copyright & License

Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).

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