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=1404&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 18324 results for "function"(1300ms)

entireGoldLarkmain.tsx1 match

@odicho•Updated 7 months ago
128
129export const service = (boardUrl: string, options?: ServiceOptions) => {
130 return async function(req: Request): Promise<Response> {
131 const url = new URL(req.url);
132 const path = url.pathname;

bbrunmain.tsx2 matches

@yejun•Updated 7 months ago
2
3/**
4 * You can supply these options as a second argument to the `proxy` function.
5 * These options are used to configure the frontend.
6 */
135
136export const proxy = (url: string, options?: FrontendOptions) => {
137 return async function(req: Request): Promise<Response> {
138 if (req.method === "GET") {
139 return renderFrontend(url, options);

bbrunREADME.md1 match

@yejun•Updated 7 months ago
13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:
16
17```ts

bbrunREADME.md1 match

@kenbarrett•Updated 7 months ago
13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:
16
17```ts

Splinemain.tsx3 matches

@mrsnor•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [SplineComponent, setSplineComponent] = useState(null);
7 const [error, setError] = useState(null);
50}
51
52function client() {
53 createRoot(document.getElementById("root")).render(<App />);
54}
56if (typeof document !== "undefined") { client(); }
57
58async function server(request: Request): Promise<Response> {
59 return new Response(
60 `

cooingTomatoSquirrelmain.tsx4 matches

@mrsnor•Updated 7 months ago
1/** @jsxImportSource npm:hono/jsx */
2async function createSession(email: string, hostname: string) {
3 const { zip } = await import("https://esm.town/v/pomdtr/sql");
4 const { sqlite } = await import("https://esm.town/v/std/sqlite");
23}
24
25async function getSession(sessionID: string, hostname: string) {
26 const { zip } = await import("https://esm.town/v/pomdtr/sql");
27 const { sqlite } = await import("https://esm.town/v/std/sqlite");
52}
53
54async function deleteSession(sessionID: string) {
55 const { sqlite } = await import("https://esm.town/v/std/sqlite");
56
64const OAUTH_COOKIE = "oauth_store";
65
66export function lastlogin(
67 handler: (req: Request) => Response | Promise<Response>,
68) {

wordPictureMatchmain.tsx3 matches

@efoley•Updated 7 months ago
107];
108
109function App() {
110 const [currentWord, setCurrentWord] = useState("");
111 const [options, setOptions] = useState([]);
177}
178
179function client() {
180 createRoot(document.getElementById("root")).render(<App />);
181}
185}
186
187export default async function server(request: Request): Promise<Response> {
188 return new Response(`
189 <html>

oceanThereminmain.tsx7 matches

@all•Updated 7 months ago
1export default async function server(request: Request): Promise<Response> {
2 const html = `
3 <html>
139 const status = document.getElementById('status');
140
141 function initAudio() {
142 audioContext = new (window.AudioContext || window.webkitAudioContext)();
143 oscillator = audioContext.createOscillator();
176 }
177
178 function togglePlay() {
179 if (!isPlaying) {
180 if (!audioContext) initAudio();
190 }
191
192 function panic() {
193 if (audioContext) {
194 oscillator.stop();
206 }
207
208 function updateAudio(event) {
209 if (!isPlaying) return;
210
222 }
223
224 function updateReverb() {
225 if (reverbNode) {
226 reverbNode.wet.value = parseFloat(reverbSlider.value);
228 }
229
230 function updateNoise() {
231 if (noiseNode) {
232 noiseNode.gain.setValueAtTime(parseFloat(noiseSlider.value), audioContext.currentTime);

bbruncmain.tsx2 matches

@dglazkov•Updated 7 months ago
2
3/**
4 * You can supply these options as a second argument to the `proxy` function.
5 * These options are used to configure the frontend.
6 */
146
147export const proxy = (url: string, options?: FrontendOptions) => {
148 return async function(req: Request): Promise<Response> {
149 if (req.method === "OPTIONS") {
150 return new Response("ok", { headers: structuredClone(CORS_HEADERS) });

smallweb_openapi_guidemain.tsx2 matches

@all•Updated 7 months ago
65}
66
67export default async function (req: Request): Promise<Response> {
68 const schema: Schema = {
69 components: {
379
380 for (i = 0; i < coll.length; i++) {
381 coll[i].addEventListener("click", function() {
382 this.classList.toggle("active");
383 var content = this.nextElementSibling;

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
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.