TagScript

TagScript Logo

TagScript

A simple and safe template engine.

Continuous Integration codecov

Packages

npm npm-tagscript npm npm-tagscript-plugin-discord

Description

TagScript is a drop in easy to use string interpreter that lets you provide users with ways of customizing their profiles or chat rooms with interactive text.

Read Full Documentation here.

Features

  • Written In Typescript
  • Offers CJS, ESM and UMD builds
  • Full TypeScript & JavaScript support
  • Blazingly Fast ⚡
  • Simple, expressive and safe template engine.
  • Supports many plugins.

Usage


Note: While examples uses import, it maps 1:1 with CommonJS' require syntax. For example,

import { Interpreter } from 'tagscript';

is the same as

const { Interpreter } = require('tagscript');

import { Interpreter, RandomParser, RangeParser, FiftyFiftyParser, IfStatementParser, SliceParser } from 'tagscript';
const ts = new Interpreter(new SliceParser(), new FiftyFiftyParser(), new RandomParser(), new IfStatementParser());

const result = await ts.run(
`
{random: Parbez,Rkn,Priyansh} attempts to pick the lock!,
I pick {if({5050:.}!=):heads|tails}
`
); // Parbez attempts to pick the lock!, I pick heads

For more usage, check out the full documentation.

Buy me some doughnuts

If you want to support me by donating, you can do so by using any of the following methods. Thank you very much in advance!

Buy Me A Coffee Buy Me a Coffee at ko-fi.com

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Parbez
Parbez

💻 🚧 🤔
WhiteSource Renovate
WhiteSource Renovate

🚧
Jeroen Claassens
Jeroen Claassens

🚧
UndiedGamer
UndiedGamer

💻
Sourav
Sourav

📖
allcontributors[bot]
allcontributors[bot]

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Projects using TagScript