User
Best Practices
- Always pass the correct module references in CommonJS (
moduleandrequire.main). - For ESM, pass
import.meta.urlandnullfor the CommonJS parameters. - Wrap all startup code or CLI logic inside
runIfMainto avoid side effects on import. - Use
isMainif you need conditional checks without running a function.