mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-28 17:22:01 +08:00
c9f2ee661c
Co-authored-by: Matsu <matias.huhta@n8n.io> Co-authored-by: Sam Wooler <swooler592@gmail.com> Co-authored-by: Dimitri Lavrenük <20122620+dlavrenuek@users.noreply.github.com> Co-authored-by: Bernhard Wittmann <bernhard.wittmann@n8n.io> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Lorent Lempereur <looorent@users.noreply.github.com> Co-authored-by: yehorkardash <yehor.kardash@n8n.io> Co-authored-by: Danny Martini <danny@n8n.io> Co-authored-by: mfsiega <93014743+mfsiega@users.noreply.github.com> Co-authored-by: phyllis-noester <102315132+phyllis-noester@users.noreply.github.com> Co-authored-by: n8n-assistant[bot] <n8n-assistant[bot]@users.noreply.github.com> Co-authored-by: Emilia <100027345+sovietspaceship@users.noreply.github.com> Co-authored-by: Robin Braumann <50590409+bjorger@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@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.