Module for download file (use stream methods)
Requires
- module:fs
- module:url
- module:http
- module:https
- module:path
Namespaces
Methods
(async, inner) ReceiveFile(url, options, callback) → {Promise.<string>}
File download function
Parameters:
Name | Type | Description |
---|---|---|
url |
string | file download link |
options |
ReceiveFileSettings | download settings object |
callback |
ReceiveFileCallback | if not set, promise will be returned |
Returns:
path - path where the file was downloaded
- Type
- Promise.<string>
Type Definitions
ReceiveFileCallback(err, path)
ReceiveFile Callback Function, if not set, promise will be returned
Parameters:
Name | Type | Description |
---|---|---|
err |
Error | if the request completed with an error, or undefined |
path |
string | if the request is successful, or undefined |