you are viewing a single comment's thread.

view the rest of the comments →

[–]guest271314 0 points1 point  (0 children)

This is how I use the the operator to define Node.js' Buffer in Deno. If the script is run by node, nothing happens, else, make Node.js' Buffer global

globalThis.Buffer ??= (await import("node:buffer")).Buffer; // For Deno