Search
aqi
@siddharth178
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 = "411038"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
aqi
@kbarienti
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 = "region Hannover "; // <-- change to place, city, or zip code
const data = await easyAQI({ location });

parsePdfData
@speepo
// THE PDF LIBRARY PROBABLY WON'T WORK WITH THE CODE AS IT IS
Express (deprecated)
// NOT FUNCTIONAL
// THE PDF LIBRARY PROBABLY WON'T WORK WITH THE CODE AS IT IS
export const parsePdfData = (req: express.Request, res: express.Response) => {

p5_sketch
@saolsen
Example p5 sketch Shows a simple example of how to use https://www.val.town/v/saolsen/p5
HTTP
import type * as p5 from "npm:@types/p5";
export function setup() {
createCanvas(400, 400);
export function draw() {
if (mouseIsPressed) {
fill("red");
diceRollerWebsite
@nuts4nuts4nuts
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useState } from "https://esm.sh/react@18.2.0";
function DiceRoller() {
const [diceType, setDiceType] = useState(4);
</div>
function client() {
createRoot(document.getElementById("root")).render(<DiceRoller />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(
calculatorApp
@Valtown12
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function Calculator() {
const [display, setDisplay] = useState("0");
</div>
function client() {
createRoot(document.getElementById("root")).render(<Calculator />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
showbot
@mvaodhan
Forward Render Error Emails to Val Town's Engineering Discord Channel Render sends emails when deploys fail but I want those notifications to come in our team Discord channel, and tag our team. Render doesn't have webhooks for this, so I set up a Gmail filter and forward to this email handler val, which in turn forwards the content to our engineering Discord channel.
Email
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
export default async function(email: Email) {
console.log(JSON.stringify(email));
if (email.from !== "Jason Lengstorf <jason@learnwithjason.dev>") return "Unauthorized";
runner
@buttondown
An interactive, runnable TypeScript val by buttondown
Cron
const USERNAME_DENYLIST = [
"buttondown.bsky.social",
const promises = ALERT_STRINGS.map(async function(keyword) {
let posts = await fetchJSON(
`https://search.bsky.social/search/posts?q=${keyword}`,
distance
@panphora
An interactive, runnable TypeScript val by panphora
HTTP
export default async function distance(req) {
const searchParams = new URL(req.url).searchParams;
const destinationA = encodeURIComponent(String(searchParams.get("a")).trim());
parseTransactions
@bao
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
function TransactionParser() {
const [inputLog, setInputLog] = useState("");
backgroundColor: "#f0f0f0",
function client() {
createRoot(document.getElementById("root")).render(<TransactionParser />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(
aqi_lefkada
@pj0
AQI Alerts Get email alerts when AQI is unhealthy near you. 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 = "lefkada greece"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
val_jkgkaOKFzC
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function isPrime(num) {
if (num <= 1) return false;
return true;
function findLowestThreeDigitPrime() {
for (let num = 100; num < 1000; num++) {
sociableWhiteLeopon
@mutindi
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function AmyFreshJuice() {
const [email, setEmail] = useState('');
paddingTop: '15px'
function client() {
createRoot(document.getElementById("root")).render(<AmyFreshJuice />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`

serveGithubRepo
@pomdtr
Serve Github Repo Example Click here to preview a commit from 8 years ago. import { serveGithubRepo } from "https://esm.town/v/pomdtr/serveGithubRepo";
export default serveGithubRepo({
owner: "mkdocs",
repo: "mkdocs",
ref: "51ec734"
}); Fork this val to get your own copy, and customize the params. The first load can be a bit slow, but subsequents requests will be cached (both in your browser and on val.town) Use it from the cli deno run --allow-net https://esm.town/v/pomdtr/serveGithubRepoCli mkdocs/mkdocs --ref 51ec734
Script
import { contentType } from "jsr:@std/media-types@1.0.0";
import { extname, join } from "jsr:@std/path@0.225.2";
export function serveGithubRepo(params: {
owner: string;
repo: string;