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

128
Views
import scoped package from local in nodejs

Currently we have multiple node package published in this format

  • @company/module1
  • @company/module2

I would like to be able to load these module from local without installing it so we can modify the code directly.

So I make the link in the folder tree like this

- company/
-- module1 -> ../../module1  
-- module2 -> ../../module2

Now I want when I import from the scoped name, it will load from local files instead

import module1 from '@company/module1'

Load from my other folder instead of looking from node_modules instalations.

Can anyone help me on this? Thank you very much.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can't import the modules, libraries, or a single file in the node.js with the common import statement import Example from "package".

So, try to use the const Example = require('package') instead.

const module1 = require("path/to/the/module1");
const module2 = require("path/to/the/module2");
about 4 years ago · Juan Pablo Isaza Report
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!