Monday, 21 September 2020

Silly question: Is it possible to only update specific files within an npm package?

So I've written a CLI app which has a save action. When it saves, the program looks for a folder in the source code dir, and if it doesn't exist, it creates it and saves the file in the new folder.when I update the package, publish it, then update my installed one via npm, it overwrites the entire package which includes my saves, as far as I can tell. Apologies I am new to node and npm.This brings me to a couple questions: How does npm exactly update a package? does it delete the entire file and reinstall it? Does it update select files? Is there a way via the package.json that if a dir exists, to leave it alone (dependent on how npm updates a package of course)I feel the next step will figure out a different place to save my files.Thanks for your time!

Submitted September 22, 2020 at 01:35AM by ASuckerForTheBlues

No comments:

Post a Comment