Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The complete ES module upgrade guide - part 5
// index.js
const { counter, increment } = require('./module');
console.log(counter);
increment();
console.log(counter);
// module.js
module.exports.counter = 0;
module.exports.increment = () => {
module.exports.counter += 1;
}
// 0
// 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.