n8n/packages/@n8n/tournament
n8n-assistant[bot] 60cc920c40
🚀 Release 2.33.0 (#35054)
Co-authored-by: n8n-release-helper[bot] <265227495+n8n-release-helper[bot]@users.noreply.github.com>
2026-07-28 07:15:34 +00:00
..
src refactor: Replace @ts-ignore with @ts-expect-error outside nodes-base (#35009) 2026-07-27 13:22:06 +00:00
test
.gitignore
biome.jsonc
eslint.config.mjs
LICENSE.md
package.json 🚀 Release 2.33.0 (#35054) 2026-07-28 07:15:34 +00:00
README.md
tsconfig.build.json
tsconfig.json chore: Migrate all base packages to TypeScript 7 (#34338) 2026-07-17 12:56:29 +03:00
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-tmpl expressions
  • 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.