I\'d like to create an application with Node.js that periodically checks for updates and installs them if there are any.
The basic components are clear to me:
A web server would be unnecessary. Git is a prefect solution for hosting public and private code & includes version control. For private repositories you can make use of the personal access tokens.
I have created a module for automatically updating node.js applications from git repositories. It compares the local package.json with the one from your repo, then automatically clones the repo and install dependencies. You can configure your app to check for updates on application start, end, or schedule routine checks.
Auto Git Update - https://github.com/chegele/AutoGitUpdate
import AutoGitUpdate from 'auto-git-update';
const config = {
repository: 'https://github.com/chegele/BackupPurger'
tempLocation: 'C:/Users/scheg/Desktop/tmp/',
ignoreFiles: ['util/config.js'],
executeOnComplete: 'C:\\Users\\scheg\\Desktop\\worksapce\\AutoGitUpdate\\startTest.bat',
exitOnComplete: true
}
const updater = new AutoGitUpdate(config);
updater.autoUpdate();