Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A JavaScript polyfill for using the global namespace with `module.exports`.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE
README.md
exports-polyfill.js
exports-polyfill.min.js

README.md

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.

Something went wrong with that request. Please try again.