Skip to content

skoranga/node-curlnsave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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) {
        ...
        ...
    }

About

Node module to curl a remote url and save a local file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published