tiny-npm-updater

Easy tiny npm-packages updater.

Usage no npm install needed!

<script type="module">
  import tinyNpmUpdater from 'https://cdn.skypack.dev/tiny-npm-updater';
</script>

README

tiny-npm-updater: Easy tiny npm-packages updater.

npm-version npm-week-downloads

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);
});

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
    },
    "log_report": {
      "logDir": "./log/log-report",
      "clear_on_startup": true,
      "save_only_uncaughtException": true,
      "enabled": true
    }
  },
  "development": {
    "isDebug": true
  }
}

License

MIT

Copyright (c) 2022 Manuel Lõhmus manuel@hauss.ee