template-message

command
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Template Message

A noderun workflow demonstrating the template node:

inject (JSON object) → template (mustache) → debug

The inject node delivers the object {"name": "world", "source": "the template node"} as msg.payload. The template node renders Hello {{payload.name}}, from {{payload.source}}! against the message and writes the rendered string back to msg.payload.

Things to notice:

  • syntax: "mustache" is the default — Node-RED parity. The node also supports gotemplate (a noderun extension rendering Go text/template against msg.payload) and plain (no substitution).
  • The mustache context is the whole message, not just the payload: {{payload.name}} drills into the payload object, while metadata like {{topic}} is reachable at top level. {{flow.X}}, {{global.X}} and {{env.X}} tags are resolved against the host context before rendering.
  • field/fieldType control where the rendered result is written — msg.payload by default, but any msg.* path or a flow/global context key works.

Run from the noderun module root:

go run ./examples/template-message

Expected output:

Hello world, from the template node!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL