liveBook · Manning

Npm

As explained in D3.js in Action, Third Edition

npm is a package manager and registry ecosystem for installing and managing JavaScript packages.

npm is a registry and package manager for installing JavaScript modules and libraries. It replaces numerous individual script references with project-managed imports and can reduce shipped code when packages are modular. section 1.2.6

npm supports practical JavaScript project workflows:

  • Install project dependencies from the registry. section 8.2
  • Add the d3 package to a React project and import D3 where needed. section 8.2
  • Use individual D3 modules instead of loading the entire library. section 1.2.6

Installing D3 in a React project

From the project root, run npm install, install the d3 package, start the project with npm run start, and import D3 with import * as d3 from 'd3';. section 8.2

npm install d3

Use the supplied npm install d3 listing to connect package installation with the working D3 project. section 8.2

How D3.js in Action, Third Edition covers it

How deep it goes
Explains npm’s package installation and module-import workflow, but does not detail registry internals or dependency resolution.
Examples
Uses npm install, npm install d3, npm run start, and a D3 namespace import in a React dashboard.
What it assumes
Assumes a JavaScript project and terminal access while introducing package installation and module importing.
What you can do after
Operate/configure JavaScript projects by installing dependencies, adding D3, starting applications, and importing packages.
How it connects
Connects npm with Node.js, JavaScript frameworks, D3.js, React, and TypeScript.

Also explained in

Compare how 5 books explain npm →

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.