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/image-url.jpg%20%22Image%20title%22?q=function&page=1906&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 19439 results for "function"(1707ms)

testSemanticsmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function testSemantics({
4 stateName,
5 api,

awaitAllmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1export async function awaitAll(value: any): Promise<any> {
2 function isPlainObject(value: any) {
3 return (typeof value === "object" && value !== null &&
4 value.constructor === Object);
5 }
6 async function innerResolve(value: any, stack: any[]): Promise<any> {
7 const resolved = await value;
8 if (stack.includes(resolved)) {

rateLimitmain.tsx1 match

@stevekrouse•Updated 1 year ago
9// you can an email every time someone tries to call it past the limit
10// usage example: https://www.val.town/v/stevekrouse.ratedLimitedFuncEx
11export function rateLimit(
12 key: string,
13 limit = 1000,

myApimain.tsx1 match

@hankenstein•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

getValIpmain.tsx1 match

@kevinkub•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getValIp() {
4 let req = await fetch("http://whatismyip.akamai.com");
5 let ip = await req.text();

myApimain.tsx1 match

@runarorama•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@robberfree•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

testApimain.tsx1 match

@clayway•Updated 1 year ago
1export async function testApi(request: Request): Promise<Response> {
2 if (request.method !== "POST") {
3 return Response.json({

myApimain.tsx1 match

@jndev•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

multiplymain.tsx1 match

@thinkle_iacs•Updated 1 year ago
1export function multiply(number) {
2 let n = Number(number);
3 return { value: `${n}×2=${n * 2}` };

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 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.