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=1&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 31542 results for "function"(3928ms)

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.

duxtoogleMenu.js2 matches

@n4k0m3•Updated 1 hour ago
1/**
2 * Initializes a mobile menu toggle functionality.
3 * Toggles the visibility of the mobile menu and updates the toggle button icon.
4 */
27 * @param {Event} event - The click event
28 */
29 function handleToggle(event) {
30 event.preventDefault();
31

duxtoogleTheme.js3 matches

@n4k0m3•Updated 1 hour ago
1/**
2 * Initializes a theme toggle functionality.
3 * Switches between light and dark modes, updates the toggle button icon, and persists the theme in localStorage.
4 */
46 * Initializes the theme based on localStorage when the DOM is fully loaded.
47 */
48 function initializeTheme() {
49 const savedTheme = localStorage.getItem("theme");
50 if (savedTheme === "dark") {
62 * @param {Event} event - The click event
63 */
64 function handleThemeToggle(event) {
65 event.preventDefault();
66
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

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