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

164
Vistas
Is there an easy way to manage state in a node/JS module by using programatically parts of npm logic?

Let's say we want to replicate part of the functionality npm has, namely, we want to know if node_modules is synced with the current state of package.json and package-lock.json, so that, if it's not, launch npm ci (if possible also programatically). Essentially we don't want to incur into the penalty of running npm ci (which can take several seconds) but do something a bit less simplistic than checking the date of node_modules against package.json.

I have checked out the dependencies of npm, and there does not seem to be one that carries that logic. arborist is more related to dependencies and its storage, pacote deals with packages. So it must be something in npm itself. Also, according to this answer we shouldn't really try and run npm from outside the CLI so I wonder if that kind of logic (which is probably used elsewhere, like yarn or grunt) is available from some other package.

At the end of the day, I want a logic similar to the one used by make: update stuff if downstream dependencies have changed somehow. node_modules vs. package.json is an example... But there could be use cases where we would also need it. At the end of the day, what I'm looking for are off-the-shelf node.js modules that would help me create a make-like tool in JavaScript.

about 4 years ago · Juan Pablo Isaza
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