New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

version-service

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

version-service

This service provides a mechanism for determining if your local SPA is out of date and needs to be refreshed.

  • 1.3.0
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Version Service

This service provides a mechanism for determining if your local SPA is out of date and needs to be refreshed.

Install

npm install --save version-service

Use

// es6
var Version = require('version-service');
// es5
var Version = require('version-service')['default'];
var url = 'some/url';
var timeout = 500;
var myVersion = '1.0.0';
var callback = function(localVersion, responseVersion) {
	//...do something when versions dont match
}
var versionService = new Version(url, timeout, myVersion, callback);

// you can run a single version check
versionService.checkVersion().then(function(version) {
	/* returns an object of signature:
    	{
        	isCurrent: localVersion === responseVersion,
            local: localVersion,
            server: serverVersion
        }
    */
});

// to run periodic checks
versionService.start();

// to cancel the periodic checks
versionService.stop();

// you can override the default getVersion function
versionService.setGetVersion(function() {
	// make an api call
	// must return a promise
});

FAQs

Package last updated on 17 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc