1// SPDX-License-Identifier: 0BSD
2import { getConfig } from "https://esm.town/v/vladimyr/jsrApi";
3import { newValURL } from "https://esm.town/v/vladimyr/newValURL";
4import { type HtmlProcessor, serveReadme } from "https://esm.town/v/vladimyr/serveReadme";
14 "redirect": req.redirect,
15 "searchParams": Object.fromEntries(searchParams.entries()),
16 "docs": "https://developer.mozilla.org/en-US/docs/Web/API/Request",
17 });
18};
1// SPDX-License-Identifier: 0BSD
2import * as jsrApi from "https://esm.town/v/vladimyr/jsrApi";
3
4const latest = await jsrApi.getLatestVersion("valibot", "valibot");
5console.log(latest);
6// ==> >=0.30.0
7
8const manifest = await jsrApi.getManifest("@valibot", "valibot", "0.30.0");
9console.log(manifest["/jsr.json"].checksum);
10// ==> sha256-d76f30c31d6700f06ff4bc0e1cf508de87e5bad348d75dbadb6376fee4359d90
11
12// @see: https://jsr.io/@valibot/valibot/0.30.0/jsr.json
13const pkgConfig = await jsrApi.getConfig("valibot", "valibot", "0.30.0");
14console.log(pkgConfig);
15// ==> { name: "@valibot/valibot", version: "0.30.0" }
20{
21 // @see: https://jsr.io/@mark/html/1.0.0/deno.json
22 const pkgConfig = await jsrApi.getConfig("mark", "html", "1.0.0");
23 console.log(pkgConfig);
24 // ==> { name: "@mark/html", version: "1.0.0" }
13];
14
15// @see: https://jsr.io/docs/api#package-metadata
16const PkgMetaSchema = v.object({
17 scope: v.string(),
20});
21
22// @see: https://jsr.io/docs/api#package-version-metadata
23const PkgVerMetaSchema = v.object({
24 manifest: v.record(
1Migrated from folder: jsr/jsrApi_example
1Migrated from folder: jsr/jsrApi
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
6 );
7 const googleAuthOptions = {
8 scope: ["https://www.googleapis.com/auth/spreadsheets"],
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {
14 method,
1// SPDX-License-Identifier: 0BSD
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import ky from "npm:ky";
4import * as v from "npm:valibot";
25
26export async function fetchVal(author: string, name: string) {
27 const prefixUrl = new URL("/v1/alias", API_URL);
28 const resp = await ky.get(`${author}/${name}`, { prefixUrl }).json();
29 return v.parse(ValSchema, resp);
8- [theme](https://github.com/vadimdemedes/thememirror/tree/main/source/themes)
9
10## API
11
12You can access the code using the `code` property: