mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-25 13:55:18 +02:00
|
|
||
|---|---|---|
| .. | ||
| src | ||
| test | ||
| .gitignore | ||
| biome.jsonc | ||
| eslint.config.mjs | ||
| LICENSE.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
@n8n/tournament
Tournament is an output-compatible rewrite of riot-tmpl for template expression evaluation.
Installation
pnpm add @n8n/tournament
Features
- Compatible with
riot-tmplexpressions - ES6 syntax support, e.g. arrow functions and template literals
- Built-in AST hooks for expression manipulation
- TypeScript support
Usage
import { Tournament } from '@n8n/tournament';
const tournament = new Tournament();
// simple expressions
tournament.execute('{{ 1 + 2 }}', {}); // 3
// with data context
tournament.execute('{{ user.name }}', { user: { name: 'John' } }); // 'John'
// template strings
tournament.execute('{{ `Hello ${user.name}!` }}', { user: { name: 'John' } }); // 'Hello John!'
// error handling
const tournament = new Tournament((error) => {
console.error('Expression error:', error);
});
Release
To release, update the version in package.json and run:
npm version {version}
npm publish
You will need permissions to publish via n8n's npm org.