Search
val_nOpADZhOkN
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function fibonacci() {
let a = 0, b = 1;
let lowestThreeDigit = null;

measureValTownE2e
@stevekrouse
// E.g. from a user's perspective (not the real execution time!)
Script
userFuncTimes.push(Date.now() - start);
console.log(
`average e2e user function time: ${
(userFuncTimes.reduce((a, b) => a + b, 0) / count).toFixed(0)
}ms (fastest was ${
valle_tmp_49647457967619054218103114793202
@janpaul123
An interactive, runnable TypeScript val by janpaul123
HTTP
export default async function(req: Request): Promise<Response> {
const html = `
<html>
val_ev8r7AvmOt
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
aqi
@codehruv
AQI Alerts Get email alerts when AQI is unhealthy near you. Set up Click Fork Change location (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via nominatim's geocoder API . Click Run Background This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast
AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI
Cron
import { email } from "https://esm.town/v/std/email?v=9";
import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
export async function aqi(interval: Interval) {
const location = "brooklyn"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
luminousOrangeDingo
@toowired
// Test starting a new goal
Script
return { success: false, error: error.message };
// Export for Val Town
export async function test(args) {
return await runTests();

open_in_fullscreen
@pomdtr
This val is supposed to be used with the val.town extension. See the extension readme for installation instructions.
Script
import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
export default async function(ctx) {
return {
type: "open",

myApi
@abhishek
An interactive, runnable TypeScript val by abhishek
Script
export function myApi(name) {
return "hi " + $abhishek;

myApi
@dhaya
An interactive, runnable TypeScript val by dhaya
Script
export function myApi(name) {
return "yo " + name;

myApi
@manuel
An interactive, runnable TypeScript val by manuel
Script
export function myApi(name) {
return "hi " + name;

myApi
@JohnMilazzo
An interactive, runnable TypeScript val by JohnMilazzo
Script
export function myApi(name) {
return "Hi, " + name;

Food
@adamgonda
An interactive, runnable TypeScript val by adamgonda
Script
export function Food(x, y) {
return { x, y };

myApi
@phl
An interactive, runnable TypeScript val by phl
Script
export function myApi(name) {
return "hi " + name;
effectorWithPatronum
@sergeysova
An interactive, runnable TypeScript val by sergeysova
Script
import { patronum } from "https://esm.town/v/effector/patronum?v=1";
import { effector } from "https://esm.town/v/effector/effector?v=2";
export async function effectorWithPatronum(req: Request) {
const { createEvent, createStore, sample } = await effector();
const { condition } = await patronum();