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=1501&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 17292 results for "function"(1211ms)

orangePiranhamain.tsx1 match

@nethanmadhav•Updated 1 year ago
4
5// Fetches a random joke.
6async function fetchRandomJoke() {
7 const response = await fetch(
8 "https://official-joke-api.appspot.com/random_joke",

modifyIframeResponsemain.tsx2 matches

@nbbaier•Updated 1 year ago
1function modifyResponse(
2 res: Response,
3) {
9}
10
11function modifyIframeResponse(
12 handler: (req: Request) => Response | Promise<Response>,
13): (req: Request) => Promise<Response> {

orangeMackerelmain.tsx2 matches

@halgendy•Updated 1 year ago
7
8// Fetches a random joke.
9// function fetchRandomJoke() {
10// const SAMPLE_JOKE = {
11// "setup": "What do you call a group of disorganized cats?",
17// Fetches a random joke.
18// Fetches a random joke.
19async function fetchRandomJoke() {
20 const response = await fetch(
21 "https://official-joke-api.appspot.com/random_joke",

salmonCrabREADME.md1 match

@stevekrouse•Updated 1 year ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37

echo_httpmain.tsx2 matches

@arrudaricardo•Updated 1 year ago
12}).partial();
13
14async function getBody(req: Request): Promise<Object> {
15 try {
16 return await req.json();
23}
24
25export default async function(req: Request): Promise<Response> {
26 const searchParams = new URL(req.url).searchParams;
27

getOpengraphMetadatamain.tsx5 matches

@dvsj•Updated 1 year ago
4
5const JSDOM = jsdom.JSDOM;
6export default async function getMetadata(url) {
7 // Do we have a URL?
8 if (url == null || url.trim() == "") {
23}
24
25function getImageUrl(frag, url) {
26 let imgUrl = "";
27 let selectors = [
65}
66
67async function getImageDataFromUrl(url) {
68 const response = await fetch(url);
69 const base64data = Buffer.from(await response.arrayBuffer()).toString("base64");
71}
72
73function getTitle(frag) {
74 let element;
75 let title = "";
99}
100
101function getDescription(frag) {
102 let element;
103 let description = "";

roseGullmain.tsx4 matches

@carissacha•Updated 1 year ago
1// Fetches a random joke.
2function fetchRandomJoke() {
3 const response = fetch(
4 "https://official-joke-api.appspot.com/random_joke",
6 return response;
7}
8function fetchRandomJoke() {
9 const SAMPLE_JOKE = {
10 "setup": "What do you call a group of disorganized cats?",
22
23// Fetches a random joke.
24function fetchRandomJoke() {
25 const SAMPLE_JOKE = {
26 "setup": "What do you call a group of disorganized cats?",
41
42// Fetches a random joke.
43async function fetchRandomJoke() {
44 const response = await fetch(
45 "https://official-joke-api.appspot.com/random_joke",

moccasinTahrmain.tsx1 match

@shivaanneu•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

orangeReptilemain.tsx1 match

@vsp05•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3async function fetchRandomJoke() {
4 const response = await fetch(
5 "https://official-joke-api.appspot.com/random_joke",

tinybase_example_clientmain.tsx1 match

@pomdtr•Updated 1 year ago
13await persister.startAutoSave();
14
15function App() {
16 // The component will be refreshed each time the store is updated
17 const count = useValue("count", store);

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week 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": "*",