/persist-request

Download a file from the internet and persist it in a cache directory.

Primary LanguageJavaScript

persist-request Build Status

persist-request will download a file and cache it in a user specified cache directory. Subsequent requests to the same file will be returned a stream from the cache rather than from the original source.

Install

npm install --save persist-request

Usage

var persistRequest = require('persist-request')('/tmp/');

var stream = persistRequest.get('http://example.com/example.tar.gz');

stream.pipe(/* to whatever */);