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=806&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 10261 results for "function"(1325ms)

ArifioreceptiveEmeraldHoverfly1 match

@arifio•Updated 2 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

ArifioforgivingTanPig1 match

@arifio•Updated 2 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

feedbackmain.ts1 match

@pomdtr•Updated 2 months ago
1import { gfm } from "https://esm.town/v/pomdtr/gfm";
2
3export default async function(req: Request): Promise<Response> {
4 const markdown = await fetch(import.meta.resolve("./README.md")).then(res => res.text());
5 const url = new URL(req.url);

APIBuilderTemplateenthusiasticPeachTapir1 match

@dcm31•Updated 2 months ago
1export default async function (interval: Interval) {
2
3}

spotifyOauthServergetSpotifyToken1 match

@charmaine•Updated 2 months ago
1import { getRow, getLatestRefreshRow, updateRow } from"./db";
2
3export async function getSpotifyToken(state: string) {
4 const authData = await getRow(state);
5 if (!authData) throw "NO_DATA";

spotifyOauthServergetSpotifyToken1 match

@neverstew•Updated 2 months ago
1import { getRow, getLatestRefreshRow, updateRow } from"./db";
2
3export async function getSpotifyToken(state: string) {
4 const authData = await getRow(state);
5 if (!authData) throw "NO_DATA";

sacredScarletSkinkmain.tsx6 matches

@charmaine•Updated 2 months ago
12];
13
14function PersonaSelector({ onSelectPersona }) {
15 return (
16 <div className="persona-selector">
33}
34
35function ChatApp({ persona, goBack }) {
36 const [messages, setMessages] = useState([
37 {
50 useEffect(scrollToBottom, [messages]);
51
52 function handleSendMessage() {
53 if (!inputMessage.trim()) return;
54
160}
161
162function App() {
163 const [selectedPersona, setSelectedPersona] = useState(null);
164
182}
183
184function client() {
185 createRoot(document.getElementById("root")).render(<App />);
186}
187if (typeof document !== "undefined") { client(); }
188
189export default async function server(request: Request): Promise<Response> {
190 return new Response(`
191 <html>

loggingTesthelperFunction2 matches

@willthereader•Updated 2 months ago
1export function squareNumber(num: number) {
2 console.log("helper function log");
3 console.log(`Squaring number: ${num}`);
4 return num * num;

loggingTestmainFunction3 matches

@willthereader•Updated 2 months ago
1import { squareNumber } from "./helperFunction";
2
3function processMathList() {
4 console.log("Starting math processing");
5 const numbers = [1, 2, 3];
7}
8
9console.log("\nTesting Math Functions:");
10console.log(processMathList());

vblogimport-file1 match

@jxnblk•Updated 2 months ago
1/** Import a file relative to the root of the project */
2export async function importFile(path: string) {
3 const url = new URL(path, import.meta.url);
4 const res = await fetch(url, { redirect: "follow" });

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago