0.1.34 • Published 4 months ago
@tryghost/tpl v0.1.34
Tpl
Install
npm install @tryghost/tpl --save
or
yarn add @tryghost/tpl
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 lerna.
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 eslintyarn test
run lint and tests
Copyright & License
Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.
0.1.34
4 months ago
0.1.33
10 months ago
0.1.31
12 months ago
0.1.32
12 months ago
0.1.30
1 year ago
0.1.29
1 year ago
0.1.28
1 year ago
0.1.27
2 years ago
0.1.26
2 years ago
0.1.25
2 years ago
0.1.23
2 years ago
0.1.24
2 years ago
0.1.22
2 years ago
0.1.21
3 years ago
0.1.20
3 years ago
0.1.19
3 years ago
0.1.18
3 years ago
0.1.17
3 years ago
0.1.15
3 years ago
0.1.16
3 years ago
0.1.14
3 years ago
0.1.13
3 years ago
0.1.10
3 years ago
0.1.11
3 years ago
0.1.12
3 years ago
0.1.9
3 years ago
0.1.8
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago