url-file-size
v1.0.5-1
Published
Get file size by URL without downloading it
Downloads
16,408
Readme
url-file-size
Get file size from URL (in bytes) without downloading it. 0 dependencies.
Params:
url
- url to get file size of. string or instance ofrequire('url').URL
(required)timeout
- connection timeout. number in milliseconds (optional, default is10000
)maxRedirects
- max amount of redirects. number (optional, default is5
)
Returns Promise<Number>
with bytes on success.
const ufs = require("url-file-size");
ufs("https://dimden.dev/logo.png")
.then(console.log) // 1416
.catch(console.error);
Created by dimden