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/$%7Bart_info.art.src%7D?q=function&page=1625&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 19270 results for "function"(1581ms)

gitmain.tsx1 match

@i•Updated 10 months ago
4};
5
6export default async function(req: Request): Promise<Response> {
7 const url = new URL(req.url);
8 const pathFirstSegment = url.pathname.replace(/(^\/+|\/+$)/g, "").split("/")[0];

TextTransformermain.tsx2 matches

@chet•Updated 10 months ago
32 <script>
33
34 async function transform() {
35 const textarea = document.getElementById('inputText');
36 const text = textarea.value;
71`;
72
73export default async function(req: Request): Promise<Response> {
74 if (req.method === "POST") {
75 const input = await req.text();

HtmlFormattermain.tsx2 matches

@chet•Updated 10 months ago
34 <script>
35
36 async function transform() {
37 const textarea = document.getElementById('inputText');
38 const text = textarea.value;
73`;
74
75export default async function(req: Request): Promise<Response> {
76 if (req.method === "POST") {
77 const input = await req.text();

multirouteVuemain.tsx3 matches

@iamseeley•Updated 10 months ago
111
112// Create a Vue app based on the current path
113function createApp(path) {
114 let component;
115 switch (path) {
129}
130
131// Main handler function
132export default async function (req: Request): Promise<Response> {
133 const url = new URL(req.url);
134 const app = createApp(url.pathname);

silverAardwolfmain.tsx1 match

@pomdtr•Updated 10 months ago
1export default function() {
2 return Response.json(Deno.args);
3}

serveCommandmain.tsx1 match

@pomdtr•Updated 10 months ago
22};
23
24export function serveCommand(
25 params: ServeCommandParams,
26): (req: Request) => Response | Promise<Response> {

blobbyFacemain.tsx4 matches

@stevekrouse•Updated 10 months ago
17
18
19async function streamToBuffer(stream) {
20 const chunks = [];
21 const reader = stream.getReader();
32}
33
34async function detectFileType(buffer) {
35 const type = await fileTypeFromBuffer(buffer);
36 // return type ? type.mime : 'unknown';
42
43
44export async function get(key, c) {
45 let result = await blobby.get(key);
46 // console.log('raw result for key:', result, typeof result);
185 newKeyName: '',
186
187 init: async function() {
188 console.log('blobby:', this.blobby);
189 },

reactServermain.tsx1 match

@iamseeley•Updated 10 months ago
6import { personalData } from "https://esm.town/v/iamseeley/personalData";
7
8export default function handler(req: Request): Response {
9 const html = `
10 <!DOCTYPE html>

sendSMSmain.tsx2 matches

@crif•Updated 10 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) {

val_town_by_example_tocmain.tsx3 matches

@pomdtr•Updated 10 months ago
15};
16
17function todo(title: string) {
18 return {
19 title: `${title}`,
96const blobKey = "val_town_by_example_toc.json";
97
98export default async function refreshToc() {
99 const toc: Toc = [];
100 for (const item of dataset) {
128}
129
130export async function readToc(): Promise<Toc> {
131 try {
132 return await blob.getJSON(blobKey);

getFileEmail4 file matches

@shouser•Updated 2 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.