User
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.
isMain() internally to determine if the module is the main entry point.fn() only when the module is running directly.