All Projects → juampi92 → auto-updater

juampi92 / auto-updater

Licence: other
Node.js auto-update plugin

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to auto-updater

Laraupdater
Enable Laravel App Self-Update. Allow your Laravel Application to auto-update itself.
Stars: ✭ 75 (+5.63%)
Mutual labels:  updater
Update Notifier
The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications.
Stars: ✭ 1,594 (+2145.07%)
Mutual labels:  updater
script-updater-for-php
A MIT Licensed script updater for projects
Stars: ✭ 24 (-66.2%)
Mutual labels:  updater
Stellar
RetroArch Nightly Updater
Stars: ✭ 93 (+30.99%)
Mutual labels:  updater
Electron Release Server
A fully featured, self-hosted release server for electron applications, compatible with auto-updater.
Stars: ✭ 1,600 (+2153.52%)
Mutual labels:  updater
Aerialcompanion
A companion app for the Aerial screen saver for macOS that takes care of install and auto-updates.
Stars: ✭ 144 (+102.82%)
Mutual labels:  updater
Sparkler
A Rails webapp that gathers and displays system statistics from Sparkle app updater (macOS/app versions etc.)
Stars: ✭ 71 (+0%)
Mutual labels:  updater
MacOS-All-In-One-Update-Script
Mac update shell script (Appstore, macOS, Homebrew and others)
Stars: ✭ 39 (-45.07%)
Mutual labels:  updater
Kymsu
Keep Your macOs Stuff Updated (KYMSU)
Stars: ✭ 119 (+67.61%)
Mutual labels:  updater
Unified Hosts Autoupdate
Quickly and easily install, uninstall, and set up automatic updates for any of Steven Black's unified hosts files.
Stars: ✭ 185 (+160.56%)
Mutual labels:  updater
Generic Auto Updater
Generic Auto-Updater: a robust, user-friendly, clean and efficient Auto-Updater to maintain any client patched.
Stars: ✭ 95 (+33.8%)
Mutual labels:  updater
Update
Update is a new developer framework and CLI for automating updates of any kind in code projects. If you know how to use assemble, generate or verb, you'll know how to use update.
Stars: ✭ 106 (+49.3%)
Mutual labels:  updater
Firupdater
Fir.im通道APK更新器,使用简单,让自己的demo快速具备升级功能
Stars: ✭ 148 (+108.45%)
Mutual labels:  updater
Project
⭐️ Antares Project Application Skeleton. This is the very first place you should start. It allows you to create a brand new awesome project in easy few steps.
Stars: ✭ 84 (+18.31%)
Mutual labels:  updater
MoalemYar
A personal project for class management, using various technologies like WPF, Entityframwork, CodeFirst, Sqlite, Migration and more
Stars: ✭ 53 (-25.35%)
Mutual labels:  updater
Git Repo Watcher
A simple bash script to watch a git repository and pull upstream changes if needed.
Stars: ✭ 73 (+2.82%)
Mutual labels:  updater
Appupdater
A library that checks for your apps' updates on Google Play, GitHub, Amazon, F-Droid or your own server. API 9+ required.
Stars: ✭ 1,793 (+2425.35%)
Mutual labels:  updater
PATCH
The PATCH repository for issues tracking, wiki and shared material.
Stars: ✭ 34 (-52.11%)
Mutual labels:  updater
AppMan
A portable AppImage manager that installs, removes, updates and manages software (locally) like APT or Pacman do.
Stars: ✭ 36 (-49.3%)
Mutual labels:  updater
Laravel Selfupdater
This package provides some basic methods to implement a self updating functionality for your Laravel application. Already bundled are some methods to provide a self-update mechanism via Github or some private repository via http.
Stars: ✭ 170 (+139.44%)
Mutual labels:  updater

Auto-Updater

Build StatusDependencies

Node.js auto-update plugin.

Compares local package.json with repository package.json and if versions don't match, it downloads the latest zip and extracts it.

Installation

With npm do:

$ npm install auto-updater

What does it do?

  • Compares local version with remote version.
  • If versions don't match, it downloads the repository.
  • It extracts the repository, overwriting the modified files.
  • Compares local dependencies with remote dependencies and tells if they don't match.

Events

  • git-clone The user has a git clone. Recommend use the "git pull" command
  • check.up-to-date ( v ) versions match
  • check.out-dated ( v_old , v) versions dont match
  • update.downloaded Update downloaded in the machine
  • update.not-installed Update was already in the dir, so it wasnt installed
  • update.extracted The update has been extracted correctly.
  • download.start ( name ) The download of "name of the update" has started
  • download.progress ( name , % ) The download has been updated. New percentage
  • download.end ( name ) The download has ended
  • download.error ( err ) Something happened to the download
  • end Called when all is over ( along with 'check-up-to-date' if there are no updates, or with 'extracted' if it was installed )

Public Methods:

  • use ( config )
  • on ( event, callback ) Sets the events (use like EventEmitter)
  • fire ( command ) Fires a command

Config

  • pathToJson: '' from repo main folder to package.json (only subfolders. Can't go backwards)
  • autoupdate: false if true, all stages run one after the other. Else, you need to force the stages with the force methods
  • checkgit: true Checks if the .git folder exists, so its a dev and doesnt download the project.
  • jsonhost: 'raw.githubusercontent.com' URL of raw remote package.json
  • contenthost: 'codeload.github.com' URL of full remote zip
  • progressDebounce: 0 Debounces the 'download.progress' event (0 = disabled)
  • devmode: false Developer Mode. Enhances error messages using console.log

Commands

  • check Compares the two versions. Triggers: 'git-clone', 'check.up-to-date', 'check.out-dated'
  • download-update Downloads the update. Triggers: 'update.downloaded', 'update.not-installed','download.*'
  • extract Extracts (or installs) the update reeplacing old files (it doesnt delete untracked files). Triggers: 'update.extracted'
  • diff-dependencies Returns an array of dependencies (only the names) that dont match. Returns an empty array if there's no difference. Requires the 'check' command first.

Warning: do not run this methods in other order.

Package.json configuration

"version":"0.0.1",
"auto-updater":{
	"repo":"/github-user/github-repo",
	"branch":"master"
}

That segment must be added to the project (local). It is critical that the package.json of the app you are using has a version field (so it can be compared with the remote package.json stored on github), and the auto-updater field, so it knows where to get the remote data.

Example

    var AutoUpdater = require('auto-updater');

    var autoupdater = new AutoUpdater({
     pathToJson: '',
     autoupdate: false,
     checkgit: true,
     jsonhost: 'raw.githubusercontent.com',
     contenthost: 'codeload.github.com',
     progressDebounce: 0,
     devmode: false
    });

    // State the events
    autoupdater.on('git-clone', function() {
      console.log("You have a clone of the repository. Use 'git pull' to be up-to-date");
    });
    autoupdater.on('check.up-to-date', function(v) {
      console.info("You have the latest version: " + v);
    });
    autoupdater.on('check.out-dated', function(v_old, v) {
      console.warn("Your version is outdated. " + v_old + " of " + v);
      autoupdater.fire('download-update'); // If autoupdate: false, you'll have to do this manually.
      // Maybe ask if the'd like to download the update.
    });
    autoupdater.on('update.downloaded', function() {
      console.log("Update downloaded and ready for install");
      autoupdater.fire('extract'); // If autoupdate: false, you'll have to do this manually.
    });
    autoupdater.on('update.not-installed', function() {
      console.log("The Update was already in your folder! It's read for install");
      autoupdater.fire('extract'); // If autoupdate: false, you'll have to do this manually.
    });
    autoupdater.on('update.extracted', function() {
      console.log("Update extracted successfully!");
      console.warn("RESTART THE APP!");
    });
    autoupdater.on('download.start', function(name) {
      console.log("Starting downloading: " + name);
    });
    autoupdater.on('download.progress', function(name, perc) {
      process.stdout.write("Downloading " + perc + "% \033[0G");
    });
    autoupdater.on('download.end', function(name) {
      console.log("Downloaded " + name);
    });
    autoupdater.on('download.error', function(err) {
      console.error("Error when downloading: " + err);
    });
    autoupdater.on('end', function() {
      console.log("The app is ready to function");
    });
    autoupdater.on('error', function(name, e) {
      console.error(name, e);
    });

    // Start checking
    autoupdater.fire('check');

Dependencies

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].