{"_id":"file_size_url","_rev":"7-9161e4b6b0d39498950d7ead8eb5a4fd","name":"file_size_url","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"file_size_url","version":"1.0.0","keywords":["url","file","size","file","size","remote","file size url","file size","size url"],"author":{"name":"dimden"},"license":"MIT","_id":"file_size_url@1.0.0","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"homepage":"https://github.com/rn0x/file_size_url#readme","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"dist":{"shasum":"d27a2a5bd08855e9e8197608336d9394b50f651b","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.0.tgz","fileCount":4,"integrity":"sha512-ratRsVL3XPfuiQ+xUaxtX51mh8KnC0dcuLYoLRc+FDe9zQJvFaVvLyI4iZaNfndMOxAd+ngaNUEdWuls8LlPZg==","signatures":[{"sig":"MEUCIE0pDpmTS+8EU8ee1tWAdnYixK/dYCdaC3ebFAbtw55lAiEA+O/NlNjn2Qb9FJJbWei5qU5acDXv8uX1SEp6ojZKXWQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM+zbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoY4Q/8CScrwhph1zYdc1Be7lLnvpZS+qYv8GmLdmSgiIh0Qhl0Fjet\r\n3ocmp7WIRbX5MjqIg6DLE7iUhVpeflmBqrsWHIcsMog5bdiwNrWJ2EPhL2sU\r\nV4tQzNMYyeXesCwpQB7PWv7tNnTDUAKyjU0oEjrL05ePMDg7+lZ0eiYFA4Kw\r\nNK1GXKcY/7YW/bSHhmVqgHQDiFuwT71QDPhiX+Ao/f14XsyFd2Q0TvG0Ew8j\r\nRFuPvYrFdEwUWAyEZdVUhzBqWD7Hx5xlfia4EoO8URqV7KXCHtYSQGLc2XL1\r\n2hqF1vemhxHEnorEgxRVqlj7iOKshjEKdAKf5g2MylYVgLmhEkAIXfI9AC0g\r\nwi7lVFU0j+mz1q+NAhHK4mRGc2pIl2Z/smYwZ0R39t7RKRvZCazor4L78rKU\r\n0ChdgjEzp+Pdh+FlpxYozHl+NTJqboSgAboS/hqefMVblaHXolMcsVmlBOWi\r\nLGQPJQUlJX70MejxXBerxyooAT8wWXncpDM/pnHsh3+V7MxLxmDViZqqxaIg\r\nr78VkTbopNsieXL09RkITEVq96DS+u/OJRoaBOlgVYtVssQDD0/aDApKQ4g2\r\neobup1pgoGsEEMMEyGDZv6D9NIwP2GZdm7E1D5g5VceVlk/stnSKQIrhS55D\r\nMQc10gwbmqWAh38tI3mr05NFcdssIQHeBFM=\r\n=4Q7m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"repository":{"url":"git+https://github.com/rn0x/file_size_url.git","type":"git"},"_npmVersion":"8.3.1","description":"Get file size by URL without downloading it","directories":{},"_nodeVersion":"16.14.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/file_size_url_1.0.0_1647570139487_0.44539873155685905","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"file_size_url","version":"1.0.1","keywords":["url","file","size","file","size","remote","file size url","file size","size url"],"author":{"name":"dimden"},"license":"MIT","_id":"file_size_url@1.0.1","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"homepage":"https://github.com/rn0x/file_size_url#readme","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"dist":{"shasum":"ad6081dfbe6262de9349a07a738ee3ed13f8082e","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.1.tgz","fileCount":4,"integrity":"sha512-sWafyC8fsxv+VEGfKAbisxJ8BUOC2w/gdlkPvQHZPbffCWaC7fihL3L+gadsa/e5bCMH4u0ljREDLLR2TsbTNQ==","signatures":[{"sig":"MEYCIQDDsackVX/4v7f9t/yIwxhajgjBNFONXUwyipEzbE6IuAIhAPmGRejxyyHDz/KzflfHwpnFPQV8JARsIAZjOy26tM2S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM/+JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfFxAApI51FhF4QCsmwdfDkYT9y38ktR+rSapsJ9xSQHe7eLJUjxRF\r\nfwXIafuKBoE7Yp3wj/IDMY3XVM5A54fpJlFTdkkpr7T/RzY3hG1wu6o9mnF/\r\nWDGcgTCdeCysXIPIIvDZDo5AEwAdJeewinCez+2R6dAkELiXhUBrH93Nt358\r\nooVQHO5qoYTBuWqgcKCsStQhOBJyesI8UNMrhLro0y7+mGYWZNhqtFT/blns\r\nUkcFckErRIaJUOdnCNRpoUjK/7BDQQdwPnqj/UnJ/zN6CCOLg7swQ8o/fKCn\r\n6TBbFb5rbddQbHDqBQ1VcHh4WOGMgJ8PEbuv1hXyG4mlvPqVKRRKJkCRQcCp\r\niFzvqC4lX7w6ARo6SR7kEyo6CjXmMyTDBCe1PAD6Jc9+7hzVS88dzE1MT7mz\r\nhZfVQ6/UVs+uBrshBjLmUCFVE3UOFPjB5LaU1HyTLRvII0RyV/4VZVlDcf15\r\nOtc7JWqXpfXXKmxr29IwokOs3wKQ42EyCydTj1FR8ACZ/KVndUPV7naa2XNU\r\nTVt99F93iRVXMjxh336yeaJmkM1A7wQVxfgRtpE+zy09s3LP83lzul0FzhnI\r\nRzg2bFhLVDX5e/C6UyFPhn2Cf8cjNWb1+4f8mFhxv6LrqG3GXITbNjFOoWYo\r\nMjsEuf1HB25D8XEQITh2GL2fINRMxKYH8Eo=\r\n=CPOq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","gitHead":"6a032e90e18bf1279c9e2e8e5d7449c3d5365eff","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"repository":{"url":"git+https://github.com/rn0x/file_size_url.git","type":"git"},"_npmVersion":"8.3.1","description":"Get file size by URL without downloading it","directories":{},"_nodeVersion":"16.14.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/file_size_url_1.0.1_1647574921178_0.37267110284194094","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"file_size_url","version":"1.0.2","keywords":["url","file","size","file","size","remote","file size url","file size","size url"],"author":{"name":"dimden"},"license":"MIT","_id":"file_size_url@1.0.2","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"homepage":"https://github.com/rn0x/file_size_url#readme","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"dist":{"shasum":"f34147150978cc55bedf62e323b30e6cf6538a19","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.2.tgz","fileCount":4,"integrity":"sha512-zKBEhwEeJMzLKtENI/71BMzyKxYuApOQIsglS1POFuJtIP08wnYQxMO+I0DYXd+gjXyN1k9o2TPazWqmaHpMlw==","signatures":[{"sig":"MEQCICEHLW3ipO/07z6UlUoGdPEOAlSJQgmTm45RXwQXkp79AiB3qsKLgbdSn/yGXPa8Py8VmcWIQK6Enj/9pFeoAQGAVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNAJLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoo1A//fFR3HB706xkcl9PRZ+5hCZLiQ3pknnaAhFj+GST5JEM1ARKJ\r\nWkHavBzieI0KYkxY6DpEJjdy2hHYZaglLsfxgElfUkGMK1hT7jzbDzvaL4Px\r\n40HZxKqIAt271WP+dqiD1LQqWYuDgkKLv7KC0Q/CM7rZz1LSQqVNnC1y1sHs\r\nu6uQUl5AphVebi+hRD0i21Hu6I/hToKe9vApmooAEMdBeAvSSm4PMPl1iHo3\r\nChylCXXEpCENk7qJfvHIV+2vf/ItwB1QuNV3zVuTrdKc45zT1/9AKz/5PWBh\r\nHjHMZSzFYwQY6Ys1bbhkFc3qafgOOo8vozal0ncX4j8jbTPasN7KipkvceGf\r\n9sjGBVjnIlkiJ/Yd/IAudwpW5M2yuCK/drOWWpHYyEIKbXx9f2Odurqlz802\r\nUbE0ETtxUXbvMMvews4tiMwEb8E4DoL+tTJT401JmCnuO+1BDQGtciThxH1I\r\ncSnd6QNE6NPURmKcAzIJWlThd04kPmcqPlTICcszqCQWI2ML8moBLHP8z9XC\r\nfUavKmipg9pnxyW2ONvZWUr5fUSBfWoa26uzznTxZohdKIE0foEolRoBoFZR\r\nDwun8A4qdvhgiRXClkGluX1oHhi9cRbROu2B+6cDGYlBnWdMLZq1s32yxJCJ\r\nV1mEY7Cqm0LBCn+GjKRyengTbfC1hA2w9t8=\r\n=8dvz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","gitHead":"6a032e90e18bf1279c9e2e8e5d7449c3d5365eff","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"repository":{"url":"git+https://github.com/rn0x/file_size_url.git","type":"git"},"_npmVersion":"8.3.1","description":"Get file size by URL without downloading it","directories":{},"_nodeVersion":"16.14.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/file_size_url_1.0.2_1647575626900_0.5143468953320842","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"file_size_url","version":"1.0.3","keywords":["url","file","size","file","size","remote","file size url","file size","size url"],"author":{"name":"dimden"},"license":"MIT","_id":"file_size_url@1.0.3","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"homepage":"https://github.com/rn0x/file_size_url#readme","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"dist":{"shasum":"61f2acd9609736b9b77999f19a923836ad115d6d","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.3.tgz","fileCount":4,"integrity":"sha512-Vw5jIDF4S9+vHC7jvtsIJFV1VMyF02Qp+y77oDtumABG+vp1gqGnV3rESkiB8GMzbk3Fxzda3ge7x3x3ms1UtQ==","signatures":[{"sig":"MEUCIENfLHDezxX2al2C5v8EnqIVn/WoD7rz83Zqa0arSSbnAiEAqekH63vgryABl44h/KTJXIL/TQFr58kdLeidU1dfpGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOf0dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLQBAAicpW6RuBaxt3e5lMU7vLAHr2l+Y94yF0YfCvSfr2/MeCW3bb\r\nlR40B5JuzBYmSJOUDW/2bp3hDYkICLMMo5KsER9Ytp/MSejYkpgUOuDcO16o\r\nodw5CH6KWQg1BgH7b3iUjKi4ClEPfBgNbvN4NoojewvnIETxbs3qPlQbwmp5\r\nByo8UYu2AfDYbwvvrXBSPqFh3JXgTff2WwfwdDBKS6fe8y5KDP7N201X/FHj\r\nd2Hed4hWJRJWG3Ceg1u4AZOufzJlrz/DWU7ByjbMzfgc9Gx13OI/49ZgVWWB\r\nnNKk64TY/28ukfJAcVLOLd/+Vfjf2bus9txrQ/DSHXAaV0wuMK+Hj9XWLu2j\r\ninn59i1nVbUX2xdfs1a9qATwx/NtS7K5Y5vA54B8G0gjktj6K8/bWTlXTBDQ\r\nOX4BhHoQpwJOwVRT5rT0R0b1k6taiBrMpru3pF4riEjqhvBZtjFPGJJZ3EXA\r\nkJunuHSlhdhmFUCnhcId9kQTdL32DKIkGXIpzLxBmi0IFnrB/7ZEApjss/lt\r\nHf6m2SEtOS8rFvdXLbu9LbD9hxSa+CqxyDACzFRfahlGfRgMTo40LvgFKDfW\r\nrlXjh49pqdh9VQjrTID3tRaee2UHnRSZi+TN2//RY12FIqMfHKaY5dBezJNT\r\ntEUCA1GzVdoGyBpShMSztHZ97Pd8LnGSl9I=\r\n=niCS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","gitHead":"5b82ba8481c74e86c025d7c18eb3c37f8e7135f7","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"repository":{"url":"git+https://github.com/rn0x/file_size_url.git","type":"git"},"_npmVersion":"8.3.1","description":"Get file size by URL without downloading it","directories":{},"_nodeVersion":"16.14.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/file_size_url_1.0.3_1647967516917_0.021241433302843005","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"file_size_url","version":"1.0.4","keywords":["url","file","size","file","size","remote","file size url","file size","size url"],"author":{"name":"dimden"},"license":"MIT","_id":"file_size_url@1.0.4","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"homepage":"https://github.com/rn0x/file_size_url#readme","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"dist":{"shasum":"bc6d34a828ba7468348331a137e3d0b8aff93f7e","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.4.tgz","fileCount":4,"integrity":"sha512-JubFtm5UEjocnPNPBXk1eUK3OkoT+COpPFn6XUdFywD4qRypru7je1/vtfSiHJzxzeQwle0YGCgm/p0KbUXfuw==","signatures":[{"sig":"MEUCIQCfoUO/1reKfNGKM5scQ/PAqZrIe060Hh++o/pcOhP1TgIgJqkJ/c3jKK6UHr+S1wuobyP/33INSm0D9PkJ7FSWtmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWcj0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmovwQ/9FTe7CAN4K0MDcHv9kr02QwNDkn30xhF2xl6DuoBX5PWeE0hE\r\nWIckzW5ZMn/DcoN9iGN1Zvu2wHsRAV94ZNEVTgiileKl/UQBNJAO+pnIM5SV\r\nM22JNJmuRpb9u2Yr3ln1arFFFKDYz6N/RMGVg4NODqgNm6ofK8zmvk0hB+i1\r\nrTnveqkokyz9DxZgIeIZM9faBsDXhmGYIopIh2i6CjkaC5NjXGQzgjf/u75D\r\nUmZvodBKTF2Q7NXDK94Gy2Z292fI3Yj9tFgdHIVz1bxvZgHL66x5iMwk7UbZ\r\n4DeyeshH9KWlNZ3QN4gnn59gO0EhKWwA2ksVpLPgro48Q2tifbzESJN9EgLM\r\nfGyH6Nz+4Ae6TGETLEwLzrk3jbFMsSwBPt1vGPrD+bpkNT0cB5+yx8wicTLT\r\nVA3fUQvbVyiG1Xj867QERsEkvVUVpuEO6vjYs1I/FKZUXr5ODzViRJyQcEDW\r\nhPGWf3bBtgSDLRkqJWn2I4NzjmpwNwBp6BKDFlNTfq6or176LwDSPDrs3xTN\r\njR+F52W7DDTHjRoEAP4J5NL7CftgnTpTOx1uVM6p7mtbBATDSudMgiuVT6FP\r\n9bZ9YyIitWwX5D+/HsmzdzDEvpesHFJlPmkn19W6VFL9z65OrTaHbQzTiHaJ\r\nvpTQXMhZnupgLBKSF1hMtWiqWuOJXN8km0g=\r\n=hL4V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","gitHead":"ece2020921def574d896adcc05e799c23cfbdeff","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"repository":{"url":"git+https://github.com/rn0x/file_size_url.git","type":"git"},"_npmVersion":"8.3.1","description":"Get file size from URL without downloading it. 0 dependencies. \nReturns Promise with 'B', 'KB', 'MB', 'GB', 'TB' on success.","directories":{},"_nodeVersion":"16.14.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/file_size_url_1.0.4_1650051316026_0.32216664636010806","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"file_size_url","version":"1.0.5","keywords":["url","file","size","remote","fetch","file size","http","https","head request","filesize","nodejs","utility"],"author":{"url":"rn0x","name":"Rayan Almalki"},"license":"MIT","_id":"file_size_url@1.0.5","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"homepage":"https://github.com/rn0x/file_size_url#readme","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"dist":{"shasum":"b7d3c41ac454c7012f03511965cd6fa93bc4ee8d","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.5.tgz","fileCount":6,"integrity":"sha512-DZqDrpFXEBbzgVg/gVzvkqg3ILbckAX1bpqIp35Av9QFMS0GvpnN7phTXWveN0+BJIMTyLcwhmQYpMDD/B41Bg==","signatures":[{"sig":"MEQCIH7RLEUEVscfz8HWG+prvRtb16A3dM+9l9V8fMaIwipxAiBs3tJON7PsBwWtcAGQdfXUFvN74Lv3HH5h3UFmT463SA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16130},"main":"index.js","type":"module","gitHead":"c141238d25a80e9863723ba71e0cfbfde5183e38","scripts":{"push":"npm publish","test":"node example/test.js"},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"repository":{"url":"git+https://github.com/rn0x/file_size_url.git","type":"git"},"_npmVersion":"10.8.1","description":"A lightweight Node.js library to fetch the file size from a remote URL without downloading the file. Zero dependencies. Returns a Promise with the file size formatted as 'B', 'KB', 'MB', 'GB', or 'TB'.","directories":{},"_nodeVersion":"20.16.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/file_size_url_1.0.5_1723355124060_0.6012626691901537","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"file_size_url","version":"1.0.6","description":"A lightweight Node.js library to fetch the file size from a remote URL without downloading the file. Zero dependencies. Returns a Promise with the file size formatted as 'B', 'KB', 'MB', 'GB', or 'TB'.","main":"index.js","type":"module","scripts":{"push":"npm publish","test":"node example/test.js"},"repository":{"type":"git","url":"git+https://github.com/rn0x/file_size_url.git"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"keywords":["url","file","size","remote","fetch","file size","http","https","head request","filesize","nodejs","utility"],"author":{"name":"Rayan Almalki","url":"rn0x"},"license":"MIT","bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"homepage":"https://github.com/rn0x/file_size_url#readme","_id":"file_size_url@1.0.6","gitHead":"d56d9e010ea018a0ec0ce25ba0cd4f38fc93fb99","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-lN41gCBrlsOM1BKujO/bPYpF75dlWbZHYSunfjHqyEPVEtjWWa7oGAdE68q+KWVXiElrNMfaRttb6IUaSkC8Pg==","shasum":"a954ff3fa79e96be2a8d160da2d0706e2cc0488f","tarball":"https://registry.npmjs.org/file_size_url/-/file_size_url-1.0.6.tgz","fileCount":6,"unpackedSize":16112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGelMuofkUybZ7ACYbwMOZE8a/ytFh2bz1vy9//7TQAAAiEA0/nWyOmiPCkiJfx2+YHNfJepFWANA50dYMJXoFy/xHI="}]},"_npmUser":{"name":"rn0x","email":"ry2n1996@gmail.com"},"directories":{},"maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file_size_url_1.0.6_1723355340204_0.566412736896541"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-18T02:22:19.440Z","modified":"2024-08-11T05:49:00.510Z","1.0.0":"2022-03-18T02:22:19.673Z","1.0.1":"2022-03-18T03:42:01.555Z","1.0.2":"2022-03-18T03:53:47.070Z","1.0.3":"2022-03-22T16:45:17.065Z","1.0.4":"2022-04-15T19:35:16.197Z","1.0.5":"2024-08-11T05:45:24.265Z","1.0.6":"2024-08-11T05:49:00.349Z"},"bugs":{"url":"https://github.com/rn0x/file_size_url/issues"},"author":{"name":"Rayan Almalki","url":"rn0x"},"license":"MIT","homepage":"https://github.com/rn0x/file_size_url#readme","keywords":["url","file","size","remote","fetch","file size","http","https","head request","filesize","nodejs","utility"],"repository":{"type":"git","url":"git+https://github.com/rn0x/file_size_url.git"},"description":"A lightweight Node.js library to fetch the file size from a remote URL without downloading the file. Zero dependencies. Returns a Promise with the file size formatted as 'B', 'KB', 'MB', 'GB', or 'TB'.","maintainers":[{"name":"rn0x","email":"ry2n1996@gmail.com"}],"readme":"# file_size_url\r\n\r\n[![NPM version](https://img.shields.io/npm/v/file_size_url.svg?style=flat)](https://www.npmjs.com/package/file_size_url)\r\n\r\n [![NPM monthly downloads](https://img.shields.io/npm/dm/file_size_url.svg?style=flat)](https://npmjs.org/package/file_size_url) \r\n \r\n [![NPM total downloads](https://img.shields.io/npm/dt/file_size_url.svg?style=flat)](https://npmjs.org/package/file_size_url) \r\n \r\n\r\n`file_size_url` is a simple Node.js library for fetching the size of a file from a given URL using either `HTTP` or `HTTPS` protocols. It returns the file size in a human-readable format such as \"1.23 MB\".\r\n\r\n**0 dependencies.**\r\n\r\n## Installation\r\n\r\nYou can install the library via npm:\r\n\r\n```bash\r\nnpm install file_size_url\r\n```\r\n\r\nAlternatively, if you have the source code, you can directly use the function in your Node.js project:\r\n\r\n```bash\r\n# Simply copy the source code file to your project directory\r\n```\r\n\r\n## Usage\r\n\r\n### Importing and Using the Library\r\n\r\n```javascript\r\nimport fileSizeUrl from 'file_size_url';\r\n\r\nfileSizeUrl(\"https://example.com/file.zip\")\r\n  .then(size => console.log(`File size: ${size}`))\r\n  .catch(error => console.error(`Error: ${error.message}`));\r\n```\r\n\r\n### Example with `telegraf` (Telegram Bot)\r\n\r\nYou can integrate `file_size_url` with `telegraf` to fetch and display file sizes in your Telegram bot:\r\n\r\n```javascript\r\nimport { Telegraf } from 'telegraf';\r\nimport fileSizeUrl from 'file_size_url';\r\n\r\nconst bot = new Telegraf('<YOUR_BOT_TOKEN>');\r\n\r\nbot.command('filesize', async (ctx) => {\r\n  const url = ctx.message.text.split(' ')[1];\r\n  if (!url) return ctx.reply('Please provide a URL.');\r\n\r\n  try {\r\n    const size = await fileSizeUrl(url);\r\n    ctx.reply(`File size: ${size}`);\r\n  } catch (error) {\r\n    ctx.reply(`Error: ${error.message}`);\r\n  }\r\n});\r\n\r\nbot.launch();\r\n```\r\n\r\n### Example with `express.js`\r\n\r\nYou can use `file_size_url` in an `express.js` server to get file sizes via an API:\r\n\r\n```javascript\r\nimport express from 'express';\r\nimport fileSizeUrl from 'file_size_url';\r\n\r\nconst app = express();\r\n\r\napp.get('/filesize', (req, res) => {\r\n  const { url } = req.query;\r\n  if (!url) return res.status(400).send('URL parameter is required');\r\n\r\n  fileSizeUrl(url)\r\n    .then(size => res.send(`File size: ${size}`))\r\n    .catch(error => res.status(500).send(`Error: ${error.message}`));\r\n});\r\n\r\napp.listen(3000, () => {\r\n  console.log('Server is running on port 3000');\r\n});\r\n```\r\n\r\n### Using `file_size_url` in a Loop\r\n\r\nYou can easily use `file_size_url` inside a loop to fetch file sizes from multiple URLs:\r\n\r\n```javascript\r\nimport fileSizeUrl from './file_size_url.js';\r\n\r\nconst urls = [\r\n  'https://example.com/file1.zip',\r\n  'https://example.com/file2.zip',\r\n  'https://example.com/file3.zip'\r\n];\r\n\r\nurls.forEach(async (url) => {\r\n  try {\r\n    const size = await fileSizeUrl(url);\r\n    console.log(`File size for ${url}: ${size}`);\r\n  } catch (error) {\r\n    console.error(`Error fetching size for ${url}: ${error.message}`);\r\n  }\r\n});\r\n```\r\n\r\n### Using `file_size_url` with `Promise.all`\r\n\r\nFetch file sizes concurrently for multiple URLs using `Promise.all`:\r\n\r\n```javascript\r\nimport fileSizeUrl from './file_size_url.js';\r\n\r\nconst urls = [\r\n  'https://example.com/file1.zip',\r\n  'https://example.com/file2.zip',\r\n  'https://example.com/file3.zip'\r\n];\r\n\r\nPromise.all(urls.map(url => fileSizeUrl(url)))\r\n  .then(sizes => {\r\n    sizes.forEach((size, index) => {\r\n      console.log(`File size for ${urls[index]}: ${size}`);\r\n    });\r\n  })\r\n  .catch(error => console.error(`Error: ${error.message}`));\r\n```\r\n\r\n## API Reference\r\n\r\n### `fileSizeUrl(url)`\r\n\r\nFetches the file size from a given URL.\r\n\r\n#### Parameters\r\n\r\n- **url** (`string`): The URL of the file.\r\n\r\n#### Returns\r\n\r\n- **Promise<string>**: Resolves with the file size as a formatted string (e.g., \"1.23 MB\"). If an error occurs, the promise is rejected with an error message.\r\n\r\n#### Example\r\n\r\n```javascript\r\nfileSizeUrl(\"https://example.com/file.zip\")\r\n  .then(size => console.log(`File size: ${size}`))\r\n  .catch(error => console.error(`Error: ${error.message}`));\r\n```\r\n\r\n### Error Handling\r\n\r\n- `Invalid URL`: If the URL is invalid or missing.\r\n- `The address should be http or https`: If the protocol is not supported.\r\n- `Failed to get file size, status code: <statusCode>`: If the HTTP status code is not 200.\r\n- `Couldn't retrieve file size from headers`: If the `content-length` header is missing or invalid.\r\n\r\n### `formatBytes(bytes)`\r\n\r\nFormats bytes into a human-readable string.\r\n\r\n#### Parameters\r\n\r\n- **bytes** (`number`): The number of bytes.\r\n\r\n#### Returns\r\n\r\n- **string**: The formatted size string (e.g., \"1.23 MB\").\r\n\r\n#### Example\r\n\r\n```javascript\r\nconsole.log(formatBytes(12345678)); // Output: \"11.77 MB\"\r\n```\r\n\r\n## Notes\r\n\r\n- Make sure the URL starts with `http://` or `https://`.\r\n- The library is designed to work only in Node.js environments that support the native `http` and `https` modules.\r\n\r\n## License\r\n\r\nThis library is available under the [MIT License](https://opensource.org/licenses/MIT).\r\n\r\n---\r\n\r\n[Arabic Documentation](/AR.md)","readmeFilename":"README.md"}