liveBook · Manning

Exports

As explained in Secrets of the JavaScript Ninja, Second Edition

A CommonJS variable that initially references a module's export object and can be used to define exported members.

In CommonJS, `exports` initially references a module’s export object and can define members of the module’s interface. Modular interfaces expose functionality while keeping implementation details hidden. section 11.1

How Secrets of the JavaScript Ninja, Second Edition covers it

How deep it goes
Identifies `exports` as a CommonJS mechanism but does not detail its mechanics or usage patterns.
What it assumes
Assumes familiarity with pre-ES6 JavaScript and builds on objects, closures, and immediate functions.
How it connects
Connects CommonJS with JavaScript objects, closures, immediate functions, and AMD modularization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secrets of the JavaScript Ninja, Second Edition. The section links point to the parts of the book it draws on.