Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
How does an import from node_modules really work in ReactJS?

I installed react-vis via npm install react-vis and its possible to write import { XYPlot, LineSeries } from 'react-vis';

I want to know how the systems knows where XYPlot and LineSeries are? I looked in the node_modules directory and there is no index.js.

The structure of the react-vis directory is the following

my-app/
├─ node_modules/
│  ├─ react-vis/
│  │  ├─ dist/
│  │  ├─ es/
│  │  ├─ CHANGELOG.md
│  │  ├─ LICENSE
│  │  ├─ package.json
│  │  ├─ README.md

How does this work? I researched and for example this does not helped me: Where { component } from 'react' is located when we are importing ReactJS?

Edit I think it looks in the package.json that is inside the react-vis directory. There are two entries that look interesting. "name": "dist" and "module": "es". I think that i have to look inside the dist directory. Inside the dist directory, there is an index.js file. I open this file and on line 318 it says exports.XYPlot = _xyPlot2.default;

In the es folder inside the index.js there is on line 98 this: export { _XYPlot as XYPlot }; I don't know if this is important.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!