SuperNode
Foundation

script

Current script execution environment.

script.env

Reads the execution environment synchronously. Regular projects and terminals use ScriptEnv.app ("app"); widget tasks use ScriptEnv.widget ("widget"). This follows the widget execution marker supplied by the host.

import { script, ScriptEnv } from "supernode";

console.log(script.env === ScriptEnv.widget ? "widget" : "app");

On this page