0.1.4 • Published 9 years ago

offline-http-sync v0.1.4

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

offline-http-sync

Build Status

offline-http-sync will download a file over http (if possible) and cache it locally where you specify. If the resource is not available, it will load the file from the cache. This is for when the availability of a resource is more important that its consistency.

Usage

Load some resource over http, saving to cache, or just from cache if http resource is not available.

var sl = require('offline-http-sync');
var resourceLoader = sl.sync('http://www.example.com/resource', './resourcecache');
resourceLoader.on('error', function(fileError, httpError) {
  console.err(httpError, 'Resource needed for startup could not be retrieved);
});
resourceLoader.on('ready', function() {
  var s = fs.readStream('./resourcecache');
});

Update the cache on demand.

resourceLoader.update();
resourceLoader.on('update', function() {
  console.log('Resource updated');
});

Milestones

  • (0.0) Download a file and store locally at startup
  • (0.1) Ability to request an update to the file (in the same process), replace the existing file and notify when it has been replaced
  • (0.2) Periodically attempt to download updated resource in the background with a good api
  • (0.3) Diff the files and only notify when the file changes
  • (0.4) Use http caching headers to reduce how resources are downloaded
  • (1.0) Well tested, api reviewed, feature complete, documented, name settled - aka Done
0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago