0.2.1 • Published 5 years ago

curlnsave v0.2.1

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

node-curlnsave

Build Status

Node module to curl a remote url and cache response locally

Usage

    var curlnsave = require('curlnsave');

    var curl = curlnsave.create({ outdir: './localCache' });
    var uri = 'http://www.example.com';

    // first time this call will download and cache the url &
    // subsequent calls will use the cached copy.
    // result { name: 'local name', data: 'data body', isFromCache: true|false}
    curl.fetch(uri, function (err, result) {
        ...
        ...
    });
    var curlnsave = require('curlnsave');

    var curl = curlnsave.create({ outdir: './localCache' });

    /**
      * options object used by [request node module](https://www.npmjs.com/package/request)
      */
    var options = { url: 'http://www.example.com' };

    // first time this call will download and cache the url &
    // subsequent calls will use the cached copy.
    // result { name: 'local name', data: 'data body', isFromCache: true|false}
    curl.fetch(options, function (err, result) {
        ...
        ...
    }
0.2.1

5 years ago

0.2.0

8 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago