0.0.7 • Published 4 years ago

remoteload v0.0.7

Weekly downloads
8
License
ISC
Repository
github
Last release
4 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

4 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago