Search
aloneAquaGopher
@parthstown
An interactive, runnable TypeScript val by parthstown
HTTP
console.log("potato", main);
export default async function printWeather(req: Request) {
if (typeof main === "function") {
const newWeather = await main(req);
} else {
console.error("main is not a function");
return new Response("Error: main is not a function", { status: 500 });

webscrapeWikipediaIntro
@vtdocs
An interactive, runnable TypeScript val by vtdocs
HTTP
const cheerio = await import("npm:cheerio");
const html = await fetchText(
"https://en.wikipedia.org/wiki/OpenAI",
const $ = cheerio.load(html);
// Cheerio accepts a CSS selector, here we pick the second <p>
val_1JZbRgM75w
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
with_yjs
@dinavinter
An interactive, runnable TypeScript val by dinavinter
Script
ActionArgs,
ActionFunction,
AnyEventObject,
doc: Y.Doc;
export default function withYjs(machine: AnyStateMachine, doc: Y.Doc) {
return machine.provide({
actors: {
"@yjs.sink": fromEventAsyncGenerator(async function*({ input }: { input: Y.Array<EventObject> }) {
let i = 0;
...e,
"@yjs.produce": fromCallback(async function*({ input, recive }) {
recive(function(event: EventObject) {
input.push([event]);
? event
: params.value instanceof Function
? params.value({ event, context })
? params
: params.path instanceof Function
? params.path({ event, context })
: params.key({ event, context });
const value = params.value instanceof Function
? params.value({ event, context })

myApi
@rssnyder
An interactive, runnable TypeScript val by rssnyder
Script
export function myApi(name) {
return "hi " + name;
val_tlShmRkTZo
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
ideaList
@nbbaier
An interactive, runnable TypeScript val by nbbaier
Script
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
import { gfm } from "https://esm.town/v/pomdtr/gfm";
export async function ideaList(author: string, name: string) {
const { code, readme } = await api(`/v1/alias/${author}/${name}`);
const title = extractMetadata("title", code);
comparableJadePtarmigan
@fahmi
An interactive, runnable TypeScript val by fahmi
HTTP
export default async function(req: Request): Promise<Response> {
const url =
"https://script.google.com/macros/s/AKfycbwzkp9Nr29pws2ShKq9ZlI1W-DaLmKBJbGBk8kYuw4bOkmyWvgdE7E6M5d6YwUITekf/exec";
users
@zokonil
An interactive, runnable TypeScript val by zokonil
HTTP
export async function untitled_lavenderReptile(req: Request): Promise<Response> {
return Response.json([{ ime: "filip" }]);

github_cmdk_extension
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { Hono } from "npm:hono";
export function githubExtension({
token: string,
const app = new Hono();
sereneBeigeSheep
@applemetabank
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
function AppointmentScheduler() {
function LegalResourceCenter() {
function App() {
function LegalChatbot() {
function client() {
export default async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
// Prepare messages for OpenAI, including system context
const completion = await openai.chat.completions.create({
ampleCopperMagpie
@akshaybondre123
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
function CreativeDeveloperPortfolio() {
const [activeSection, setActiveSection] = useState("home");
</motion.div>
function client() {
createRoot(document.getElementById("root")).render(<CreativeDeveloperPortfolio />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(
turquoiseTuna
@megansitz
An interactive, runnable TypeScript val by megansitz
Script
function x() {
console.log("Welcome to CS1200!");
console.log("Hello there!");