liveBook · Manning

Module

As explained in D3.js in Action, Third Edition

The JavaScript module system provides import and export declarations for sharing bindings between separately scoped source modules.

JavaScript modules let separately scoped source files share bindings through imports and exports. In D3 projects, NPM provides modules as libraries that can be imported instead of loading individual files with script tags. section 1.2.6

A modular D3 project can:

  • Load the full D3 library or import only the parts it needs. section 1.2.6
  • Use a bundler such as Parcel to combine JavaScript files and NPM modules into browser-readable files. section 11.0

How D3.js in Action, Third Edition covers it

How deep it goes
Connects imports to project setup and smaller files, but stops short of explaining import and export syntax.
Examples
Uses full-versus-individual D3 imports and a Parcel project setup as examples.
What you can do after
Apply it via NPM and Parcel to import selected D3 modules and prepare browser-readable project files.
How it connects
Links modules with NPM, D3, bundlers, and JavaScript frameworks.

Also explained in

Compare how 36 books explain module →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.