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=1513&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 17232 results for "function"(1226ms)

github_emailsmain.tsx1 match

@wittjosiah•Updated 1 year ago
3import { parse } from "https://esm.town/v/wittjosiah/parse_github_email";
4
5export default async function(message: Email) {
6 console.log(JSON.stringify(message, null, 2));
7 if (!message.from.endsWith("<notifications@github.com>")) {

dailyStandupBotmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),

playgroundmain.tsx5 matches

@pomdtr•Updated 1 year ago
8};
9
10async function execute(
11 code: string,
12): Promise<{ ok: true; logs: Log[] } | { ok: false; error: string }> {
18 const markStackStart = crypto.randomUUID();
19 const markStackEnd = crypto.randomUUID();
20 function cleanStack(stack: string) {
21 let lines: string[] = [];
22 for (const line of stack.split("\n")) {
33 get(target, key) {
34 const real = target[key];
35 if (typeof real === "function" && typeof key === "string") {
36 const fn = function(...args: any[]) {
37 logs.push({
38 level: key,
49 },
50 });
51 async function run() {
52 try {
53 await import(url);

resilientFetchmain.tsx1 match

@easrng•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2async function proxiedFetch(req: Request): Promise<Response> {
3 let query = new URLSearchParams({
4 url: req.url,

aqimain.tsx1 match

@andreterron•Updated 1 year ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export async function aqi(interval: Interval) {
5 const location = "brooklyn navy yard"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

instructorExamplemain.tsx1 match

@inkpotmonkey•Updated 1 year ago
12const client = Instructor({
13 client: oai,
14 mode: "FUNCTIONS",
15});
16

blobCountermain.tsx1 match

@Negash•Updated 1 year ago
1import { blob } from "https://esm.town/v/std/blob?v=11";
2
3export default async function(req: Request): Promise<Response> {
4 const count = (await blob.getJSON("blobCounter") ?? 0) + 1;
5 await blob.setJSON("blobCounter", count);

playgroundREADME.md1 match

@pomdtr•Updated 1 year ago
8- only script vals supported
9
10everything else should be fully functional.
11
12you can prefill the editor with

sayHimain.tsx1 match

@bryanhelmig•Updated 1 year ago
1export function sayHi(name: string): string {
2 return "hi " + name;
3}

ntfyReqREADME.md1 match

@arrudaricardo•Updated 1 year ago
1Export function to publish NTFY notification
2
3reference: https://docs.ntfy.sh/publish/#publish-as-json

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