tiny-npm-updater
v1.3.5
Published
Easy tiny npm-packages updater.
Downloads
27
Maintainers
Readme
tiny-npm-updater: Easy tiny npm-packages updater.
Easy tiny npm-packages updater. Launches the CLI command 'npm update' in background.
Installing
npm install npm-packages updater
Usage example
app.js
var updater = require('tiny-npm-updater');
updater.options.updateCheckInterval_seconds = 30;
updater.on('error', function (err, pkgName) { console.error(err); });
updater.on('updated', function (pkgName, isUpdated, info) {
if (isUpdated) {
//restartAPP();
}
console.log('pkg:', pkgName);
console.log(info);
});
console.log(updater.outdated());
var updateLater = true;
updater.update(updateLater); // Launches the CLI command 'npm update' after 30s
Config-sets file
config-sets.json
{
"production": {
"isDebug": false,
"tiny_npm_updater": {
"current_working_directory": "",
"updateCheckInterval_seconds": 86400,
"logDir": "./log/tiny-npm-updater",
"autoupdate": true
},
"log_report": {
"logDir": "./log/log-report",
"clear_on_startup": true,
"save_only_uncaughtException": true,
"enabled": true
}
},
"development": {
"isDebug": true
}
}
License
Copyright (c) 2022 Manuel Lõhmus [email protected]