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=1748&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 18321 results for "function"(1953ms)

getInvitesFromRedditmain.tsx1 match

@francoischalifour•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function getInvitesFromReddit() {
4 const codeRegex = /bsky-social-[a-zA-Z0-9]+/g;
5 const result = await fetchJSON(

webassemblyExamplemain.tsx1 match

@mkeller7•Updated 1 year ago
14 const importObj = {};
15 const { instance } = await WebAssembly.instantiate(source.buffer, importObj);
16 const addTwo = instance.exports.addTwo as CallableFunction;
17 return addTwo(2, 3);
18};

myApimain.tsx1 match

@salman•Updated 1 year ago
1export function myApi(url) {
2 return "https://tldrify.com/ajaxproxy?url=" + url;
3}

helloMessagemain.tsx1 match

@blindly•Updated 1 year ago
1export async function helloMessage(MESSAGE) {
2 console.log(`Message: ${MESSAGE}`);
3}

asyncThrowmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { delay } from "https://esm.town/v/andreterron/delay";
2
3export async function asyncThrow() {
4 await delay(100);
5 throw new Error("Error thrown on async function");
6}

searchTweetsmain.tsx1 match

@andreterron•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function searchTweets({ accessToken, query, params }: {
4 accessToken: string;
5 query: string;

myApimain.tsx1 match

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

analysisTransactionmain.tsx1 match

@j1ang•Updated 1 year ago
1export function analysisTransaction(req: express.Request, res: express.Response) {
2 console.log(req.body);
3 res.end("Handle Webhook Success");

postToMastodonmain.tsx1 match

@sebdd•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export function postToMastodon(mastodonApiUrl, mastodonAccessToken, status) {
4 return fetch(
5 `${mastodonApiUrl}/statuses?access_token=${mastodonAccessToken}`,

kaiterra_prometheusmain.tsx2 matches

@tehmantra•Updated 1 year ago
2
3// Fetches air quality sensor data from Kaiterra in prometheus line format
4export async function kaiterra_prometheus(
5 req: express.Request,
6 res: express.Response,
13 let prometheus_data = kiosk_data.indoor.flatMap((indoor_data) =>
14 indoor_data.data.flatMap((data) =>
15 data.points.flatMap(function (point) {
16 let timestamp = new Date(point.ts).getTime();
17 let param_name = data.param.replace("-", "_");

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.