n8n/packages/@n8n/tournament
n8n-assistant[bot] b970d259c4
🚀 Release 2.20.0 (#29761)
Co-authored-by: Matsuuu <16068444+Matsuuu@users.noreply.github.com>
2026-05-05 09:14:22 +00:00
..
src chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +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 🚀 Release 2.20.0 (#29761) 2026-05-05 09:14:22 +00:00
pnpm-lock.yaml chore: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +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: Move @n8n/tournament to monorepo (#29358) 2026-04-29 08:32:50 +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.