Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

data-updater

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-updater - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

4

lib/DataUpdater.js

@@ -82,4 +82,4 @@ var _ = require('lodash');

this._updating = false;
this.emit('error', err);
this._mayBeEmitFirstUpdate(err);
this.emit('error', err);
this._scheduleUpdate();

@@ -98,4 +98,4 @@ };

this._updating = false;
this._mayBeEmitFirstUpdate();
this.emit('update', data);
this._mayBeEmitFirstUpdate(null);
this._scheduleUpdate();

@@ -102,0 +102,0 @@ };

{
"name": "data-updater",
"version": "2.1.0",
"version": "2.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,18 +12,26 @@ # data-updater

```js
var DataUpdater = require('data-updater');
var dataUpdater = require('data-updater');
var dataUpdater = new DataUpdater('path/to/data.json', 1000);
var updater = dataUpdater.fromFile('path/to/data.json', 1000);
dataUpdater.on('error', function(err) {
updater.on('error', function(err) {
// Runs if an error occurs to read the data file
});
dataUpdater.on('old', function() {
updater.on('old', function() {
// Runs when data file was not updated since last attempt
});
dataUpdater.on('update', function(data) {
updater.on('update', function(data) {
// Runs when data file was updated sice last attempt
})
});
update.on('first-update', function(err) {
// Runs after first update attempt, can be unsuccessful
});
update.on('first-successful-update', function() {
// Runs after first successful update attempt
});
```
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