(url: string)
| 13 | const db = 'GeoLite2-City'; |
| 14 | |
| 15 | const download = async (url: string): Promise<Parser> => { |
| 16 | return new Promise((resolve) => { |
| 17 | https.get(url, (res) => { |
| 18 | const gunzip = zlib.createGunzip(); |
| 19 | const parser = tar.t(); |
| 20 | |
| 21 | res.pipe(gunzip).pipe(parser as any); |
| 22 | resolve(parser); |
| 23 | }); |
| 24 | }); |
| 25 | }; |
| 26 | |
| 27 | async function main(): Promise<void> { |
| 28 | let url = `https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/${db}.tar.gz`; |