https://github.com/imranbarbhuiya/tagscript
A simple and safe template engine.
https://github.com/imranbarbhuiya/tagscript
hacktoberfest safe-parsing string-parser tagscript
Last synced: 2 months ago
JSON representation
A simple and safe template engine.
- Host: GitHub
- URL: https://github.com/imranbarbhuiya/tagscript
- Owner: imranbarbhuiya
- License: mit
- Created: 2022-04-19T06:26:01.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T16:35:03.000Z (2 months ago)
- Last Synced: 2025-04-09T17:43:08.307Z (2 months ago)
- Topics: hacktoberfest, safe-parsing, string-parser, tagscript
- Language: TypeScript
- Homepage: https://tagscript.js.org
- Size: 18.2 MB
- Stars: 27
- Watchers: 3
- Forks: 6
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# TagScript
**A simple and safe template engine.**
[](https://github.com/imranbarbhuiya/TagScript/actions/workflows/continuous-integration.yml)
[](https://codecov.io/gh/imranbarbhuiya/tagscript)## Packages
[](https://www.npmjs.com/package/tagscript)
[](https://codecov.io/gh/imranbarbhuiya/tagscript)
[](https://www.npmjs.com/package/tagscript)
[](https://www.npmjs.com/package/@tagscript/plugin-discord)
[](https://codecov.io/gh/imranbarbhuiya/tagscript)
[](https://www.npmjs.com/package/@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](https://tagscript.js.org/).
## 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](https://github.com/imranbarbhuiya/tagscript/packages/).## Usage
---
**Note:** While examples uses `import`, it maps 1:1 with CommonJS' require syntax. For example,
```ts
import { Interpreter } from 'tagscript';
```is the same as
```js
const { Interpreter } = require('tagscript');
```---
```ts showLineNumbers
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 documentation [here](https://tagscript.js.org/).
## 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!
## Contributors ✨
Thanks goes to these wonderful people: