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/image-url.jpg%20%22Image%20title%22?q=function&page=1822&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 18741 results for "function"(1068ms)

testHTMLmain.tsx1 match

@rodrigotello•Updated 1 year ago
1export function testHTML(req: express.Request, res: express.Response) {
2 res.send(
3 "<html lang='en'>" +

denoGameHTMLmain.tsx9 matches

@rodrigotello•Updated 1 year ago
27 };
28
29 function setup() {
30 createCanvas(800, 300);
31 resetGame();
32 }
33
34 function resetGame() {
35 dino = new Dino();
36 obstacles = [];
41 }
42
43 function draw() {
44 if (isGameOver) {
45 showGameOver();
94 }
95
96 function keyPressed() {
97 if (keyCode === 32) {
98 if (isGameOver) {
107 }
108
109 function gameOver() {
110 isGameOver = true;
111 let name = prompt("Enter your name (max 16 characters, no spaces):");
113 scoreboard.push({ name, score });
114
115 // Call the function to update the scoreboard on the Val Town API
116 updateScoreboard(name, score);
117 }
118
119 function updateScoreboard(name, score) {
120 const apiUrl =
121 "https://api.val.town/v1/run/rodrigotello.updateDinoScoreboard";
147 }
148
149 function showGameOver() {
150 background(255);
151 textAlign(CENTER);
176 }
177
178 function showGamePaused() {
179 background(255);
180 textAlign(CENTER);

peelSessionLettersmain.tsx1 match

@aeaton•Updated 1 year ago
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
2
3export async function peelSessionLetters() {
4 const url = `https://www.bbc.co.uk/radio1/johnpeel/artists/`;
5 const dom = await fetchHtmlDom(url);

myApimain.tsx1 match

@sander•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@pmenze•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@sarincasm•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

testmain.tsx1 match

@Timmy•Updated 1 year ago
1export const test = (async function init() {
2 const res = await import("https://esm.sh/web-features/index.json") assert { type: "json" };
3 return res;

mainmain.tsx1 match

@Timmy•Updated 1 year ago
2import { getIssueNumber } from "https://esm.town/v/Timmy/getIssueNumber";
3
4export async function main() {
5 let latestIssue = 643;
6 const init = (async () => {

myApimain.tsx1 match

@pjlamb12•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

polygonPriceOnDatemain.tsx1 match

@rwev•Updated 1 year ago
1import { polygonDailyAPI } from "https://esm.town/v/rwev/polygonDailyAPI";
2
3export async function polygonPriceOnDate(ticker, isoDate) {
4 const response = await polygonDailyAPI(ticker, isoDate);
5 if (response.status != "OK")

getFileEmail4 file matches

@shouser•Updated 2 weeks 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": "*",