Exports Polyfill
A JavaScript polyfill for using the global namespace with module.exports
.
Usage
Use module.exports
as described in the documentation to read/extend the namespace.
module.exports = {
foo: 42
};
console.log(module.exports.foo); // 42
console.log(foo); // 42
Use the exports
shortcut to read the namespace.
module.exports = {
foo: 42
};
console.log(exports.foo); // 42
Use module.namespace
to change the namespace.
var obj = {};
module.namespace = obj;
module.exports = {
foo: 42
};
console.log(obj.foo); // 42
console.log(exports.foo); // 42
Support
Please open an issue for questions and concerns.
Contributing
Fork this repository, commit your changes, and open a pull request.