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=1797&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 18129 results for "function"(2442ms)

moveHeadmain.tsx1 match

@adamgonda•Updated 1 year ago
1export function moveHead(head, dir) {
2 if (["RIGHT", "LEFT"].includes(dir)) {
3 return {

Diamond_Rendermain.tsx1 match

@ralfw•Updated 1 year ago
1import { Diamond_Produce } from "https://esm.town/v/ralfw/Diamond_Produce";
2
3export async function Diamond_Render(req: express.Request, resp: express.Response) {
4 const size = parseInt(req.query.size);
5 const diamond = Diamond_Produce(size);

pollVotingJobmain.tsx4 matches

@pranjaldotdev•Updated 1 year ago
4let { successCount } = await import("https://esm.town/v/pranjaldotdev/successCount");
5
6export async function pollVotingJob({ lastRunAt }: Interval) {
7 console.log("Last run was ", lastRunAt);
8 function sleep(ms: number) {
9 return new Promise((resolve) =>
10 setTimeout(() => {
14 );
15 }
16 async function doVote(): Promise<boolean> {
17 try {
18 const votingURL =
45 }
46 }
47 async function fireRequests() {
48 console.log("Script booting up 🚀");
49 let successRequest = 0;

getWeathermain.tsx1 match

@sdan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getWeather(city: string) {
4 try {
5 const response = await fetch(`https://wttr.in/${city}?format=j1`);

testMutateSemanticsmain.tsx1 match

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

chatGPTPluginmain.tsx1 match

@stevekrouse•Updated 1 year ago
3
4// https://stevekrouse-chatgptplugin.express.val.run/.well-known/ai-plugin.json
5export async function chatGPTPlugin(req: express.Request, res: express.Response) {
6 if (req.path === "/.well-known/ai-plugin.json") {
7 res.json({

openaiFineTunemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function openaiFineTune({ key, model, trainingFile }: {
4 key: string;
5 model?: string;

parseSendGridEmailmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1export function parseSendGridEmail(input) {
2 function parseString(input) {
3 if (typeof input === "string") {
4 // parse email out of format like 'name <email@email.com>'

resendmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function resend({ from, to, subject, html, text, apiKey }: {
4 from: string;
5 to: string;

signECDSAmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function signECDSA(message, key) {
2 let encoded = new TextEncoder().encode(message);
3 return crypto.subtle.sign(

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
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": "*",