Dev Helpers
← Back

Use a symbol channel name

Use a symbol channel name using Node.js.

Open this example in the interactive library

Source code

import { channel, subscribe, unsubscribe } from "node:diagnostics_channel";
const name = "helpers:sample";
const ch = channel(name);
console.log(channel(Symbol.for("demo")).name.toString());

Sample output

Symbol(demo)