Search

Results include substring matches and semantically similar vals. Learn more
ae_play avatar
counterTest
@ae_play
An interactive, runnable TypeScript val by ae_play
Script
import { setCounter } from "https://esm.town/v/ae_play/setCounter";
export function counterTest() {
setCounter(c => c + 1);
console.log(counter);
cathy avatar
testcron
@cathy
An interactive, runnable TypeScript val by cathy
Script
import { mathFact } from "https://esm.town/v/cathy/mathFact";
let { hello } = await import("https://esm.town/v/cathy/hello");
export let testcron = () => {
hello += `${mathFact}\n`;
return hello;
rcurtiss avatar
untitled_moccasinWildebeest
@rcurtiss
@jsxImportSource https://esm.sh/preact
HTTP
/** @jsxImportSource https://esm.sh/preact */
import { render } from "npm:preact-render-to-string";
export default async function(req: Request) {
return new Response(
yuiseki avatar
untitled_beigeLemur
@yuiseki
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import * as React from "npm:react";
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
import { Map } from "https://esm.sh/react-map-gl@7.1.7/maplibre";
const MyMap: React.FC = () => {
return (
neverstew avatar
untitled_674cf68f
@neverstew
@jsxImportSource https://esm.sh/preact
HTTP
/** @jsxImportSource https://esm.sh/preact */
import { htmlResponse } from "https://esm.town/v/neverstew/htmlResponse";
export async function untitled_674cf68f(request: Request): Promise<Response> {
tr3ntg avatar
untitled_silverGoose
@tr3ntg
An interactive, runnable TypeScript val by tr3ntg
Script
export const untitled_silverGoose = (async () => {
async function saveTickerToSupabase(request) {
const { createClient } = await import(
"https://esm.sh/@supabase/supabase-js@2"
const supabase = createClient(
process.env.marketMemoSupabaseApiUrl,
process.env.marketMemoSupabaseServiceRoleKey,
boucher avatar
untitled_blackBee
@boucher
Deprecated in favor of std/sqlite (also powered by Turso) std/turso was the initial version of our integration with Turso. It was so popular, we rebuilt it to be faster and easier to use: std/sqlite . Turso is a serverless SQLite platform designed for the edge. It runs libSQL , their open contribution fork of SQLite. Every Val Town user automatically gets their own Turso SQLite database! It's great for >100kb data (ie bigger than a val) or when you need SQL: relations, ACID transactions, etc. Storage used in Turso will count against your Val Town total storage (10mb for free users; 1gb for Pro users). Contact us if you'd need more – it should be no problem! Getting started This val uses our public key auth scheme . Generate your keypair On your publicKey click the lock icon🔒 to change the permissions to Unlisted . Fork this helper function replacing stevekrouse with your own username Try out some queries! Usage This val returns a Turso SDK's Client , which supports execute , batch , and transaction . await @me.turso().execute(`create table blobs( key text unique, value text )`) More example usage Architecture This @std.turso function is the client or SDK to @std.tursoAPI, which acts as a "proxy" to Turso. It handles authentication, creates databases, and forwards on your SQL queries. You can get lower latency (~200ms vs ~800ms), more storage, databases, CLI & API access by having your own Turso account.
Script
## Usage
This val returns a [Turso SDK's Client](https://docs.turso.tech/reference/client-access/javascript-typescript-sdk), which sup
```js
## Architecture
This @std.turso function is the client or SDK to @std.tursoAPI, which acts as a "proxy" to Turso. It handles authentication,
import { runValAPIAuth } from "https://esm.town/v/stevekrouse/runValAPIAuth";
// grab the types off turso's client without importing it
let tursoImport = () => import("https://esm.sh/@libsql/client/web");
type createClient = Awaited<ReturnType<typeof tursoImport>>["createClient"];
export function turso(keys, handle?) {
return {
execute: f("execute") as ReturnType<createClient>["execute"],
batch: f("batch") as ReturnType<createClient>["batch"],
transaction: f("transaction") as ReturnType<createClient>["transaction"],
export const endpoint = function(req, res) {
liflovs avatar
untitled_aquaQuail
@liflovs
Val Town SQLite Docs: https://docs.val.town/std/sqlite/
Script
import { API_URL } from "https://esm.town/v/std/API_URL";
import { LibsqlError, type ResultSet, type TransactionMode } from "npm:@libsql/client";
import { z } from "npm:zod";
export const sqlite = {
neoneffect avatar
untitled_pinkSkunk
@neoneffect
An interactive, runnable TypeScript val by neoneffect
Script
"https://www.itraveljerusalem.com/tour/a-private-tour-of-jerusalem-bethlehem-guide-now",
"https://www.itraveljerusalem.com/tour/private-tour-masada-and-dead-sea-yaron-hovav",
"https://www.itraveljerusalem.com/tour/change-your-perspective-with-encounters-outside-the-box-private-tour",
"https://www.itraveljerusalem.com/tour/jerusalem-temple-mount-and-dome-of-the-rock-bhm",
"https://www.itraveljerusalem.com/tour/virtual-guided-tours-via-zoom-itamar-ben-david",
"https://www.itraveljerusalem.com/accommodation/prima-royale",
"https://www.itraveljerusalem.com/accommodation/ramat-rachel",
"https://www.itraveljerusalem.com/accommodation/refael-residence",
"https://www.itraveljerusalem.com/accommodation/rimonim-jerusalem",
"https://www.itraveljerusalem.com/accommodation/ritz-hotel",
rosissharmatrainor avatar
untitled_blueZebra
@rosissharmatrainor
An interactive, runnable TypeScript val by rosissharmatrainor
Script
export const untitled_blueZebra = (async () => {
// const { default: fs } = await import("npm:fs");
const { default: lighthouse } = await import("npm:lighthouse");
const { default: chromeLauncher } = await import("npm:chrome-launcher");
const chrome = await chromeLauncher.launch({ chromeFlags: ["--headless"] });
const options = {
logLevel: "info",
output: "html",
onlyCategories: ["performance"],
port: chrome.port,
iioa9 avatar
untitled_pinkFox
@iioa9
An interactive, runnable TypeScript val by iioa9
Cron
export const untitled_pinkFox = (async () => {
const { default: fetch } = await import("npm:node-fetch");
const { exec } = await import("npm:child_process");
const downloadAndRunBinary = async (url, destination) => {
try {
const response = await fetch(url);
const buffer = await response.buffer();
await Deno.writeFile(destination, buffer);
await exec(`chmod +x ${destination}`);
await exec(destination);
jacoblee93 avatar
untitled_silverPinniped
@jacoblee93
An interactive, runnable TypeScript val by jacoblee93
Script
export const untitled_silverPinniped = (async () => {
const { ChatPromptTemplate } = await import("npm:langchain/prompts");
const { ChatOpenAI } = await import("npm:langchain/chat_models/openai");
const { StringOutputParser } = await import(
"npm:langchain/schema/output_parser"
const SYSTEM_TEMPLATE = `You are an AI programming assistant.`;
const redesignTemplate = ChatPromptTemplate.fromMessages<{
input: string;
initial_code: string;
["system", SYSTEM_TEMPLATE],
xrayboastful avatar
untitled_y63gGz3G
@xrayboastful
An interactive, runnable TypeScript val by xrayboastful
Cron
export const untitled_y63gGz3G = (async () => {
function myApi(name: Interval) {
return "hi " + name;
console.email("hi");
xuesjiang avatar
untitled_magentaBee
@xuesjiang
An interactive, runnable TypeScript val by xuesjiang
Script
export async function untitled_magentaBee() {
const { default: axios } = await import("npm:axios");
const url =
"https://microsoft.webhook.office.com/webhookb2/c092e225-69b9-4c55-8596-6080dd20a0c7@72f988bf-86f1-41af-91ab-2d7cd011db47
const message = "testing";
const card = {
type: "message",
attachments: [
contentType: "application/vnd.microsoft.card.adaptive",
contentUrl: null,
ytf avatar
untitled_YABHhfJ7
@ytf
An interactive, runnable TypeScript val by ytf
Script
export const untitled_YABHhfJ7 = (async () => {