MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / download

Function download

packages/geo/scripts/download.ts:15–25  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

13const db = 'GeoLite2-City';
14
15const 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
27async function main(): Promise<void> {
28 let url = `https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/${db}.tar.gz`;

Callers 1

mainFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected