Update index.js

Not all environments define the global _module_. Verify that it exists before using it