Search
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
living
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
import { html } from "https://esm.town/v/stevekrouse/html";
import { alive as alive2 } from "https://esm.town/v/stevekrouse/alive";
export async function living(req: Request) {
let name = decodeURI(new URL(req.url).pathname.replace("/", ""));
let alive, error;
scientificSalmonBonobo
@ugochionyejiaka
// Fetches a random joke.
Script
// ... imports ...
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
sqliteExplorerApp
@tay
SQLite Explorer View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal . This is now more an SPA, with tables, queries and results showing up on the same page. Install Install the latest stable version (v86) by forking this val: Authentication Login to your SQLite Explorer with password authentication with your Val Town API Token as the password. Todos / Plans [ ] improve error handling [ ] improve table formatting [ ] sticky table headers [x] add codemirror [ ] add loading indication to the run button (initial version shipped) [ ] add ability to favorite queries [ ] add saving of last query run for a table (started) [ ] add visible output for non-query statements [ ] add schema viewing [ ] add refresh to table list sidebar after CREATE/DROP/ALTER statements [ ] add automatic execution of initial select query on double click [x] add views to the sidebar [ ] add triggers to sidebar [ ] add upload from SQL, CSV and JSON [ ] add ability to connect to a non-val town Turso database [x] fix wonky sidebar separator height problem (thanks to @stevekrouse) [x] make result tables scrollable [x] add export to CSV, and JSON (CSV and JSON helper functions written in this val . Thanks to @pomdtr for merging the initial version!) [x] add listener for cmd+enter to submit query
HTTP
- [x] make result tables scrollable
- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
- [x] add listener for cmd+enter to submit query
![jkell avatar](https://images.clerk.dev/oauth_github/img_2RlULrTGFioQtLC6JgMYKuAAGDw.jpeg)
myApi
@jkell
An interactive, runnable TypeScript val by jkell
Script
export function myApi(name) {
return "hi " + name + "from" + $me;
![luketurner avatar](https://images.clerk.dev/oauth_github/img_2RFstfgKUf1K8clfRbyZWtjnOsr.jpeg)
myApi
@luketurner
An interactive, runnable TypeScript val by luketurner
Script
export function myApi(name) {
return "hi " + name;
lazyCook
@karkowg
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function App() {
const [numPeople, setNumPeople] = useState(4);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
function extractJSONFromMarkdown(markdown: string): string {
const jsonMatch = markdown.match(/```json\n([\s\S]*?)\n```/);
return jsonMatch ? jsonMatch[1] : "";
export default async function server(request: Request): Promise<Response> {
if (request.method === "POST" && new URL(request.url).pathname === "/recipes") {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
const { numPeople, numRecipes, difficulty, cuisine, ingredients, unit, dietaryRestrictions } = await request.json();
try {
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
"content-type": "text/html",
async function generateImage(recipeName: string): Promise<string> {
const response = await fetch(`https://maxm-imggenurl.web.val.run/${encodeURIComponent(recipeName)}`);
web_YrdKpc0KUo
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_YrdKpc0KUo(req) {
return new Response(`<!DOCTYPE html>
<html>
myApi
@easterc
An interactive, runnable TypeScript val by easterc
Script
export function myApi(name) {
return "hi " + name;
![yawnxyz avatar](https://images.clerk.dev/oauth_github/img_2NnaHhpxNuH1xWRIRjQNoo16TVc.jpeg)
wahoo
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json( {message: 'hello!!'})
![dace avatar](https://images.clerk.dev/oauth_github/img_2TSWp0BoKDHzVkwXos9ffpm9Sd8.jpeg)
myApi
@dace
An interactive, runnable TypeScript val by dace
Script
export function myApi(name) {
return "hi " + name;
myApi
@rraval
An interactive, runnable TypeScript val by rraval
Script
export function myApi(name) {
return "hi " + name;
myApi
@triggatron
An interactive, runnable TypeScript val by triggatron
Script
export function myApi(name) {
return "hi " + name;
myApi
@charlesfrisbee
An interactive, runnable TypeScript val by charlesfrisbee
Script
export function myApi(name) {
return "hi " + name;