0.0.7 • Published 5 years ago

remoteload v0.0.7

Weekly downloads
8
License
ISC
Repository
github
Last release
5 years ago

remoteload

simple library to load array of urls into a local temporary folder.

installation

npm install remoteload

or clone the repository :)

usage

inclusion
const remoteload = require("remoteload");
load resources
remoteload
    .loadURLs(["https://pixabay.com/en/photos/download/puppy-1502565_1920.jpg"])
    .then(i_sFolder => console.log("URLs Copied to folder: ", i_sFolder));

the loadURls method returns a promise which will receive the temporary folder as argument.

load resource data
remoteload
    .loadURLsData(["https://pixabay.com/en/photos/download/puppy-1502565_1920.jpg"])
    .then(i_aDataBuffers => console.log("Data Buffers received: ", i_aDataBuffers.length));

the loadURLsData method returns a promise which will receive an array of buffer objects refering to the data retrieved from the requested urls.

load options

options are valid for both loadURLs and loadURLsData method.

  • onProgress function : function being call each time a progress can be reported
  • maxChunkSize number : number of files to try to load simultaneously, set to 0 or lower to disable
remoteload
    .loadURLs(["https://pixabay.com/en/photos/download/puppy-1502565_1920.jpg"], { onProgress: (i_nType, i_oData) => {
        console.log("Progress Report: ", i_nType, i_oData);
    }})

##### cleanup
```javascript
remoteload
    .cleanup()
    .then(() => console.log("All loaded folders cleaned up!"));

the cleanup method returns a promise.

0.0.7

5 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago