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%22Optional%20title%22?q=function&page=2132&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 22493 results for "function"(1823ms)

myApimain.tsx1 match

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

addReactFromCDNmain.tsx1 match

@liamdanielduffy•Updated 1 year ago
1import { scriptTag } from "https://esm.town/v/liamdanielduffy/scriptTag";
2
3export function addReactFromCDN(): string {
4 const reactDom = scriptTag({
5 src: "https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js",

myApimain.tsx1 match

@pigrange•Updated 1 year ago
1export function myApi(name) {
2 return JSON.parse(
3 '{"code": 0,"message": "success","data": {"param1": "va success"}}',

wttrJsonmain.tsx1 match

@rwev•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrJson(location: string) {
4 // https://github.com/chubin/wttr.in#json-output
5 return (await fetch(`https://wttr.in/${location}?format=j1`)).json();

bggTestmain.tsx1 match

@clayton•Updated 1 year ago
1import { fetchXML } from "https://esm.town/v/stevekrouse/fetchXML?v=3";
2
3export const bggTest = async function () {
4 const xml = await fetchXML(
5 "https://boardgamegeek.com/xmlapi2/plays?username=acciopatronus",

rawmain.tsx1 match

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function raw(val: `@${string}.${string}`) {
4 const [owner, name] = val.slice(1).split(".") as string[];
5 return fetchJSON(

runmain.tsx1 match

@neverstew•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function run(
4 { username, valName, data, token }: Params,
5): Promise<Result> {

myApimain.tsx1 match

@impactvelocity•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}
1export function getRotationFromFFmpegDisplayMatrixString(str: string) {
2 let elements = str.match(/[-+]?\d+/g)?.map(Number) || [];
3 if (elements.length !== 9) {

handleSanguineGithubWebhookmain.tsx1 match

@nico•Updated 1 year ago
2import process from "node:process";
3
4export async function handleSanguineGithubWebhook(
5 req: express.Request,
6 res: express.Response,

getFileEmail4 file matches

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

tuna8 file matches

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