Socket
Socket
Sign inDemoInstall

@tryghost/tpl

Package Overview
Dependencies
1
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/tpl


Version published
Maintainers
0
Install size
68.7 kB
Created

Readme

Source

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 eslint
  • yarn test run lint and tests

Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.

FAQs

Last updated on 04 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc