deno.land / x / trex@v1.13.1 / utils / db.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** * Copyright (c) Crew Dev. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */
import { offLine } from "./logs.ts";
type pkgResponse = { name: string; description: string; star_count: number;};
/** * get module list from deno api * @param {string} query */export async function denoApidb(query: string) { // * get all thirt party const response = (await fetch( `https://apiland.deno.dev/v2/modules/${query}`, ).catch((_) => offLine())) as Response;
const database = await response.json();
if (database?.name == query) { return [database] as Array<pkgResponse>; }
return [];}
/** * get module info */export const moduleUrl = (name: string, version: string) => `https://cdn.deno.land/${name}/versions/${version}/meta/meta.json`;
/** * get module versions */export const moduleVersions = (name: string) => `https://cdn.deno.land/${name}/meta/versions.json`;
trex

Version Info

Tagged at
9 months ago