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/image-url.jpg%20%22Optional%20title%22?q=function&page=2349&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 24761 results for "function"(4420ms)

myApimain.tsx1 match

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

githubFollowersmain.tsx1 match

@stungeye•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function githubFollowers() {
4 let followers = await fetchJSON(
5 "https://api.github.com/users/stungeye/followers",

homemain.tsx1 match

@rym•Updated 1 year ago
3
4// Access via https://api.val.town/v1/express/rym.home
5export async function home(req: express.Request, res: express.Response) {
6 const blocks = await blocks2();
7 console.log(

getCurrentWeekmain.tsx1 match

@ray1214•Updated 1 year ago
1// 第几周
2export function getCurrentWeek(): number {
3 const now = new Date();
4 const firstDayOfYear = new Date(now.getFullYear(), 0, 1);

expressHTMLExamplemain.tsx1 match

@slade•Updated 1 year ago
1export async function expressHTMLExample(req, res) {
2 return res.send(`<h1>Hi ${req.query.name || req.body.name}!</h1>`);
3}

myApimain.tsx1 match

@sbeben•Updated 1 year ago
1export function myApi() {
2 return ` <!DOCTYPE html><html lang=";
3 en;

myFirstValmain.tsx1 match

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

harryPotterDatamain.tsx1 match

@byzantine_emperor•Updated 1 year ago
2
3// when a request comes in fetch hpotter data
4export async function harryPotterData(req: express.Request, res) {
5 try {
6 const responseData = await fetch(

notifyInTgmain.tsx1 match

@dpetrouk•Updated 1 year ago
2import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
3
4export async function notifyInTg(chatId, text) {
5 telegramSendMessage(
6 process.env.telegramBotToken,

forwardermain.tsx1 match

@maas•Updated 1 year ago
1export function forwarder(e: {
2 from: string;
3 to: string[];

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month 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.