Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

120
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda