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/$%7Bsuccess?q=function&page=2395&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 27609 results for "function"(2286ms)

modifyImagemain.tsx1 match

@ilikescience•Updated 9 months ago
1import { ImageMagick, initializeImageMagick, MagickGeometry } from "https://deno.land/x/imagemagick_deno@0.0.14/mod.ts";
2
3export async function modifyImage(
4 file: File,
5 params: { width: number; height: number },

Countdown2main.tsx2 matches

@all•Updated 9 months ago
2// It uses CSS for styling and animations and JavaScript for the countdown logic.
3
4export default async function main(req: Request): Promise<Response> {
5 const html = `
6 <!DOCTYPE html>
52 </div>
53 <script>
54 function updateCountdown() {
55 const eventDate = new Date('2025-04-14T00:00:00');
56 const now = new Date();

violetKoalamain.tsx3 matches

@void•Updated 9 months ago
1async function fetchWeather() {
2 const API_KEY = "439d4b804bc8187953eb36d2a8c26a02"; // Example key, replace with your own
3 const LAT = 51.5074; // London latitude
22}
23
24function generateHTML(weather, url) {
25 if (!weather || !weather.current) {
26 console.error("Weather data not available");
61}
62
63export default async function main(req) {
64 const weather = await fetchWeather();
65 const url = `http://api.openweathermap.org/data/2.5/forecast/daily?q=London&appid=439d4b804bc8187953eb36d2a8c26a02`;

superchargedQueryParamsmain.tsx1 match

@neverstew•Updated 9 months ago
23const pairPattern = /([a-zA-Z0-9_-]+)([=!<>]=?|[<>])(.+)/;
24
25export function superchargedQueryParams(url: URL): ParsedQuery {
26 return decodeURIComponent(url.search)
27 .slice(1)

lostKeysmain.tsx5 matches

@moe•Updated 9 months ago
15let hueBase
16
17export function setup() {
18 canvasSize = 800
19 numberOfSquares = Math.floor(random(4, 10))
34}
35
36export function draw() {
37 background(0)
38
49}
50
51function drawSquare(x, y) {
52 let inset = gridSize * 0.06
53 let size = gridSize - inset
97}
98
99export function keyPressed() {
100 if (key == "i") {
101 saveCanvas("p5js-" + new Date().getTime(), "png")
105 }
106}
107// export function touchEnded() {
108// saveCanvas("p5js-" + new Date().getTime(), "png");
109// }

dateme_homemain.tsx1 match

@iamseeley•Updated 9 months ago
4import Layout from "https://esm.town/v/stevekrouse/dateme_layout";
5
6export default function Home(c) {
7 const AutocompleteInput = () => {
8 const [inputValue, setInputValue] = useState('');

thomasResumeHandlermain.tsx1 match

@ttodosi•Updated 9 months ago
4import { resumeConfig } from 'https://esm.town/v/iamseeley/thomasResumeConfig';
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === 'GET') {
8 try {

linkInBioTemplatemain.tsx1 match

@ttodosi•Updated 9 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

dailyStandupBotmain.tsx1 match

@ttodosi•Updated 9 months ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),

spotifymain.tsx1 match

@MichaelNollox•Updated 9 months ago
12}
13
14export default async function main(req: Request): Promise<Response> {
15 if (req.method === "GET") {
16 // Retrieve and return all comments

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.