So I am wondering if this is even possible or is this is even a good idea...So I have an NodeJS app where I want people to download and run a local server on their local machine. The people will download the source code in Github, you know....then they unzip the file, run npm i, an then npm start and they are off.I was thinking of maybe using some sort of packaging tool like http://ift.tt/2pJcVLV to make it easier for users but I will focus on that later...besides, using that packing tool might still not answer my question on "how to send updates".Or maybe I could use NPM to update...but then again, this is not an npm package, it's a full on app server. (or does NPM not really care ? And how would I achieve this...)So this is my idea on how to accomplish this:On the package.json I have the version number like so: "0.0.1", following the convention, the last value in this version would be the 'patch' version.Every time you run the server via npm start or whatever, it will go to github, get that package.json from the project and check it with the current version of your package.json. If it's different, it will notify you that there is an update. You press okay and....then what ?I imagine here I would get the zip file from github and unzip in the root directory, replacing all the files...but what about the node_modules ? what if I added a new dependency ? I guess I could update the package.json file and tell the user to run npm i, or do it for them if there is a new dependency.I imagine that I would have a js file that will handle this updating of unzipping the file from github. Now what happens if I update the the update file ? Huh... any advice or ideas would be appreciate. Or if I am seriously overthinking this please tell me...could there be a package out there already available that I could use ? Could NPM help me here ?
Submitted June 03, 2017 at 11:42PM by HappyZombies
No comments:
Post a Comment