libvalence
Library for secure updates with Soatok's Valence project
Installing
Use npm to add libvalence as a dependency.
npm install --save libvalence
Usage
The public API for libvalence is called Bond
. Configuration should be
straightforward:
const Bond = ; // Initializelet bond = Bond; // If the user has an access token (e.g. stored in a text file), you can// set it like so:bond; // Add Chronicles, require 2 out of 3 to agree:bond ;
Once your Bond
is setup and configured, you can use it like so to fetch
updates from the server and install them:
/** @var */bond;
Update Policies
By default, libvalence uses a semantic versioning update policy, which will automatically apply PATCH updates but not MAJOR or MINOR version changes.
Old Version | New Version | Auto-Update? |
---|---|---|
v1.4.13 | v1.4.14 | YES |
v1.4.13 | v1.4.15 | YES |
v1.4.13 | v1.5.0 | NO |
v1.4.13 | v1.5.14 | NO |
v1.4.13 | v2.0.0 | NO |
v1.4.13 | v2.5.0 | NO |
v1.4.13 | v2.4.14 | NO |
You can create your own update policy like so:
const UpdatePolicy = UpdatePolicy; moduleexports = /** * @param * @param * @returns */ { // Apply your logic here... return false; };
And then you can add it to your Bond
instance like so:
const CustomUpdatePolicy = ; /** @var */bond;