Easy to use Templating system. Let your user's write scripts themselves
npm i @typicalninja21/tagscript
Docs are available at here
All of these Examples are in Typescript If you want to use Javascript you will have to convert the example's to javascript
- Base Code: This is the base code needed for below examples
import { Parser } from '@typicalninja21/tagscript'
const parser = new Parser();
// get a new Context
const ctx = parser.getNewCtx();
Below is a full complete script to showcase the features of this package, you can see below for more specific examples
// ctx is defined in above base snippet
// choose() is a default function, you will have to apply it
// process and its sub property is a default function, you will have to apply it
const script = `
{var = 'string'}
{"var is defined as $(var)"}
{func = choose('today is great'; 'today is bad')}
{"is today great? $(func)"}
{randomOfRandom = choose(func; 'idk')}
{"Random of Random is $(randomOfRandom)"}
`
// use the parse function
ctx.parse(script).then(console.log).catch(console.log)
We offer a web bundle that is bundled with webpack and is available at the following cdns
- If possible download this and host on your own website (recommended)
- If not just directly use one of the following cdns (not recommended):
jsdelivr (recommended)
You can find a Live Demo / Tagscript Editor here
The editor utilizes the web bundle
Yess, this library allows you to extend it's functionality without directly interacting with the source code
here is A simple Guide on this Subject
You can click here for guide on this topic or Click here for guide
A Complete guides for users wanting to write their own scripts can be found here
This package was made for my own discord bot's (axix v2) custom commands / tags system
- If you need support for this package, please join the support server