n8n/packages/@n8n/tournament
n8n-cat-bot[bot] 81e3c07fd8
Some checks failed
Build: Benchmark Image / build (push) Waiting to run
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.15.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Sync API Docs / sync-public-api (push) Waiting to run
Release: Schedule Patch Release PRs / Create patch release PR (${{ matrix.track }}) (beta) (push) Has been cancelled
Release: Schedule Patch Release PRs / Create patch release PR (${{ matrix.track }}) (stable) (push) Has been cancelled
Release: Schedule Patch Release PRs / Create patch release PR (${{ matrix.track }}) (v1) (push) Has been cancelled
chore: Routine dependency maintenance (no-changelog) (#32164)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Declan Carroll <declan@n8n.io>
2026-06-11 18:33:14 +00:00
..
src fix(core): Resolve empty expressions to empty string in VM evaluator (#30310) 2026-05-12 14:08:31 +00:00
test chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
.gitignore chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
biome.jsonc chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
eslint.config.mjs chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
LICENSE.md chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
package.json chore: Routine dependency maintenance (no-changelog) (#32164) 2026-06-11 18:33:14 +00:00
pnpm-lock.yaml chore: Routine dependency maintenance (no-changelog) (#32164) 2026-06-11 18:33:14 +00:00
README.md chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
tsconfig.build.json chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00
tsconfig.json chore: Create a lightweight version of pnpm reset (#32125) 2026-06-11 12:24:46 +00:00
vite.config.ts chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +00:00

@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.