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=1417&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 17278 results for "function"(2110ms)

easyAQImain.tsx1 match

@rishabhparikh•Updated 9 months ago
7const cacheKey = location => "easyAQI_locationID_cache_" + encodeURIComponent(location);
8
9export async function easyAQI({ location }: {
10 location: string;
11}) {

urlMetadatamain.tsx1 match

@yawnxyz•Updated 9 months ago
1import urlMetadata from 'npm:url-metadata';
2
3export async function getUrlMetadata(url) {
4 try {
5 const metadata = await urlMetadata(url);

acemain.tsx2 matches

@saolsen•Updated 9 months ago
90 return c.render(
91 <div id="editor">
92 {html`function foo(items) {
93 var x = "All this is syntax highlighted";
94 return x;
98});
99
100export default async function handler(req: Request): Promise<Response> {
101 return await app.fetch(req);
102}

onlineStatusmain.tsx2 matches

@lilyjordan•Updated 9 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export function getStaticProps() {
5 return {
6 props: {},
8}
9
10export default async function(req: Request) {
11 return new Response(
12 renderToString(

roseGiraffemain.tsx1 match

@lilyjordan•Updated 9 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

sendSMSmain.tsx2 matches

@limboy•Updated 9 months ago
8};
9
10export async function sendSMS(phoneNumber: string, message: string, carrier: string): Promise<void> {
11 const carrierDomain = carriers[carrier.toLowerCase()];
12 if (!carrierDomain) {
22 text: message,
23 });
24 console.log('Email function returned:', result);
25 console.log('SMS sent successfully');
26 } catch (error) {

notifymain.tsx1 match

@samwho•Updated 9 months ago
2import process from "node:process";
3
4export async function notify(request: Request) {
5 if (request.method === "OPTIONS") {
6 return new Response("", {

randomCardImagemain.tsx1 match

@jamiedubs•Updated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export default async function(req: Request): Promise<Response> {
4 try {
5 const response = await fetch(

streammain.tsx3 matches

@tempguy•Updated 9 months ago
13 };
14}
15function getSeasonEpisode(text) {
16 const pattern = /s(\d{1,3})e(\d{1,4})/i;
17 const match = text.match(pattern);
112 return c.json(apiResponse);
113});
114async function scrapeMoviesFiles(directoryList, febboxId: string) {
115 return directoryList;
116}
117async function scrapeSeriesFiles(directoryList, febboxId: string, season: number, episode: number) {
118 for (const [i, item] of directoryList["data"]["file_list"].entries()) {
119 if (item.file_icon === "dir_icon" && item.file_name.includes("eason")) {

googleGenerativeAIStreamingExamplemain.tsx1 match

@tr3ntg•Updated 9 months ago
1import { GoogleGenerativeAI } from "npm:@google/generative-ai";
2export default async function(req: Request): Promise<Response> {
3 const genAI = new GoogleGenerativeAI(Deno.env.get("your-api-key"));
4 const generativeModel = genAI.getGenerativeModel({

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