{"params":{"appName":"docs","slugs":["hbh-nodes","ismain-and-runifmain","best-practices"],"_slug":"hbh-nodes__ismain-and-runifmain__best-practices","flatPath":"docs/hbh-nodes/ismain-and-runifmain/best-practices"},"siteBase":"https://hbhhub.online","websiteBase":{"protocol":"https:","host":"hbhhub.online"},"BlogProps":{"subdomain":"docs","slug":"hbh-nodes/ismain-and-runifmain/best-practices","BlogPath":"$$Blogs$$/docs/hbh-nodes/ismain-and-runifmain/best-practices.md"},"siteName":"docs","appName_L0":"docs","UIAppName":"HBHDocs"}Best Practices
- Always pass the correct module references in CommonJS (
module and require.main).
- For ESM, pass
import.meta.url and null for the CommonJS parameters.
- Wrap all startup code or CLI logic inside
runIfMain to avoid side effects on import.
- Use
isMain if you need conditional checks without running a function.
HBH Hub - Modern Web Solutions & Digital Platform