npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nodejs-sum

v0.0.3

Published

A simple update manager for Electron apps on Windows OS

Readme

nodejs-sum

Simple Update Manager

node

A very simple update manager module for Electron apps on Windows OSs.

This is a collection of useful functions for apps for Windows maded with Electron to update them in an easy way. You only have to add this package to your app and execute two functions to perform an update of the app itself. Basically it allows you to upload a zip archive, containing your builded updated app, on a server along with a version.json file containing the version and the name of the app inside the zip archive. Then, from you application, you can call a function to search on a specfied url the presence of an update and another function to perform the download, the unzipping and installation of the updated app.

Installation

npm install nodejs-sum

DEPENDENCIES

Electron Node.js adm-zip

USAGE

  1. Import the module on your project:
const sumHelper = require('nodejs-sum');
  1. Call the function checkUpdates() to search for available updates:
const result = []; // An empty array that will contain the result of the request
const appVersion = require('../../package.json').version; // A constant with the app version readed directly from the package.json file of the app (pay attention at the path of your package.json file that may not corresponds to the one of this example)

sumHelper.checkUpdates('http://www.yoursite.it/updatesFolder/version.json', appVersion, result); // Search for updates

where the first parameter is the url where to find the version.json file to read the version informations, the second parameter is the current version of the app retrieved directly from the package.json file of the app or a manual inserted string with the actual app's version number and the third parameter is an empty array that will contain the result of the request.

  1. Now you have to watch the result[] array to be fulfilled (this is necessary because all the updates requests and functions are asynchronous so it is not possible to wait or block the program execution until the requests and functions are ended). If the result[] array will change it will contain:
result = [
  0 index = Boolean -> True if an update is available - False otherwise
  1 index = String  -> The new version number of the app readed from the version.json file from the update server
  2 index = String  -> The app name readed from the version.json file from the update server
  3 index = String  -> Present ONLY if errors are throwed and it contains an error message
]
  1. When an update is found, you can call the other function downloadUpdate() that will download the update's zip archive inside a temporary folder (that will be deleted when the update will finish) on the current working directory of the app and will start the executable to install the update:
const version = result[1]; // Store the string containing the version of the update
const appName = result[2]; // Store the string containing the app's name
result = [];               // Empty the array to store the result of the next async function

sumHelper.downloadUpdate('http://www.yoursite.it/updatesFolder/update_1.0.0.zip', 'update.zip', appName, version, result);

where the first parameter is the url where to download the zip archive, the second parameter is the name to assign at the downloaded zip archive on your disk, the third parameter is the name of the app, the fourth parameter is the version of the update and the fifth parameter is an empty array that will contain the result of the operation:

result = [
  0 index = String -> 'success' if the operations are executed correctly or an error message if errors are throwed
]
  1. Build your updated project. Pay attention to the version string inside the package.json file of the app that must be correct.
npm run build
  1. Create a .zip archive of the builded app's files and name it, for example, update_1.0.0.zip.

  2. Create a version.json file to be uploaded later on your server containing a string with the version of the update that will be uploaded on the server and the name of the app that you can found on the package.json file of the app.

{
  "version": "1.0.0",
  "name": "Simple App"
}
  1. Upload the update_1.0.0.zip and the version.json file on a folder inside your online server.

At the moment this package only supports Windows OS but in the future I will support other OS.