Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=function&page=1549&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 18129 results for "function"(2571ms)

pyodideSquaremain.tsx1 match

@iamseeley•Updated 11 months ago
17
18 <script>
19 async function main() {
20 let pyodide = await loadPyodide();
21 console.log('Pyodide is ready to use!');

Candlewood_Lake_Temp_Alertsmain.tsx2 matches

@samk•Updated 11 months ago
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4
5export default async function(interval: Interval) {
6 const lastLakeTemp = await blob.getJSON("lastLakeTemp");
7 const temperature = await getLakeTemp();
43}
44
45export async function getLakeTemp() {
46 const result = await fetchText("https://www.omniafishing.com/w/candlewood-lake-3-fishing-reports/current-conditions");
47 const temperature = result.match(/<strong>([0-9]+)/)[1];

Daily_Candlewood_Lake_Temp_Alertsmain.tsx2 matches

@stevekrouse•Updated 11 months ago
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4
5export default async function(interval: Interval) {
6 const lastLakeTemp = await blob.getJSON("lastLakeTemp");
7 const temperature = await getLakeTemp();
43}
44
45export async function getLakeTemp() {
46 const result = await fetchText("https://www.omniafishing.com/w/candlewood-lake-3-fishing-reports/current-conditions");
47 const temperature = result.match(/<strong>([0-9]+)/)[1];

unawaitedAsyncExamplemain.tsx1 match

@stevekrouse•Updated 11 months ago
1export async function handle() {
2 // Schedule work to do later
3 (async () => {

tanCranemain.tsx1 match

@frmysantana•Updated 11 months ago
1import cheerio from "npm:cheerio";
2
3export default async function tacoBellNutritionScrapper(req) {
4 const sourceUrl = `https://www.nutritionix.com/taco-bell/menu/premium`;
5 const siteText = await fetch(sourceUrl);

handlemain.tsx1 match

@janpaul123•Updated 11 months ago
1export async function handle() {
2 // Schedule work to do later
3 (async () => {

pollRSSFeedsmain.tsx1 match

@janpaul123•Updated 11 months ago
3import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds";
4
5export async function pollRSSFeeds({ lastRunAt }: Interval) {
6 return Promise.all(
7 Object.entries(rssFeeds).map(async ([name, url]) => {

redScallopmain.tsx1 match

@iamseeley•Updated 11 months ago
1export default async function handler(req: Request): Promise<Response> {
2
3

pyodideModmain.tsx2 matches

@iamseeley•Updated 11 months ago
2import { executePython } from "https://esm.town/v/iamseeley/pyodideExecutor";
3
4export async function runPythonCode(code: string) {
5 const pyodide = await initializePyodide();
6 return await executePython(pyodide, code);
7}
8
9export function runPythonCodeInWorker(code: string): Promise<string> {
10 return new Promise((resolve, reject) => {
11 const worker = new Worker(new URL("https://esm.town/v/iamseeley/pyodideWorker", import.meta.url), { type: "module" });

testingRunAllInValTownmain.tsx1 match

@iamseeley•Updated 11 months ago
1import { runPythonCode } from "https://esm.town/v/iamseeley/pyodideMod";
2
3export default async function handler(req: Request): Promise<Response> {
4 const pythonCode = `
5import numpy as np

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",