{"params":{"appName":"docs","slugs":["hbh-nodes","ismain-and-runifmain","runifmainimportmetaurl-cjsmodule-mainmodule-fn","behavior-2"],"_slug":"hbh-nodes__ismain-and-runifmain__runifmainimportmetaurl-cjsmodule-mainmodule-fn__behavior-2","flatPath":"docs/hbh-nodes/ismain-and-runifmain/runifmainimportmetaurl-cjsmodule-mainmodule-fn/behavior-2"},"siteBase":"https://hbhhub.online","websiteBase":{"protocol":"https:","host":"hbhhub.online"},"BlogProps":{"subdomain":"docs","slug":"hbh-nodes/ismain-and-runifmain/runifmainimportmetaurl-cjsmodule-mainmodule-fn/behavior-2","BlogPath":"$$Blogs$$/docs/hbh-nodes/ismain-and-runifmain/runifmainimportmetaurl-cjsmodule-mainmodule-fn/behavior-2.md"},"siteName":"docs","appName_L0":"docs","UIAppName":"HBHDocs"}Behavior
- Calls
isMain() internally to determine if the module is the main entry point.
- Executes the provided function
fn() only when the module is running directly.
- Safe for mixed ESM + CommonJS environments.
HBH Hub - Modern Web Solutions & Digital Platform