Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
Developing a local npm package

I am developing a npm package. Lets call it my-library. I publish this package to a private npm repository which is pulled by many of my projects. How can I quickly develop the code in my-library without having to publish a new version of my-library every time I make a small change?

Take the following workflow for example:

  1. I make a change to my-library. The change is still in development so I don't want to publish it to all my consumers yet, but I do want to test it locally.
  2. I run npm pack to create a local .tgz file.
  3. In one of my dependent projects, say my-consumer I update the package.json to reference this local .tgz file. "my-library": "file:../some/path/my-package.tgz"
  4. I run npm install in my-consumer and my local package is not installed and I can test my app.

Now, there isn't anything apparently wrong with the aforementioned steps, but say I am very quickly iterating on my-library and I want to make and test changes very quickly. Is there any way I can make the above process go faster? Running pack and install for every little change takes time and is much slower than if this were hot-reloading. Can I configure my package.json in my-consumer to use a cached version of my-library that is not in the node_modules folder and skip some of the above steps? I also don't want this to introduce any dependency issues.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I'm using npm/yarm link for that. it allows you to symlink your library to your project, and therefore have the most updated code without any publish and install.

Basically the syntax is:

cd /path/to/lib
yarn link
cd /path/to/project
yarn link myLibName

Take a look at the yarn link docs.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda