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/$2?q=function&page=2398&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 24748 results for "function"(4883ms)

incrementmain.tsx1 match

@_•Updated 1 year ago
1let { count } = await import("https://esm.town/v/_/count");
2
3export function increment() {
4 count += 1;
5 return count;

getWeatherGovDatamain.tsx1 match

@wilt•Updated 1 year ago
3// Currently broken! Val.Town cannot fetch from .gov sites
4// You can get these input values by calling https://api.weather.gov/points/{latitude},{longitude}
5export async function getWeatherGovData({ office, gridX, gridY }) {
6 const data = await fetchJSON(
7 `https://api.weather.gov/gridpoints/${office}/${gridX},${gridY}/forecast`

untitled_y63gGz3Gmain.tsx1 match

@xrayboastful•Updated 1 year ago
1export const untitled_y63gGz3G = (async () => {
2 function myApi(name: Interval) {
3 return "hi " + name;
4 }

mainReferencemain.tsx1 match

@karfau•Updated 1 year ago
1export function mainReference<T = ValRef>(transform?: Transform<T>): T {
2 const stack = new Error().stack;
3 let refs: ValRef[] = stack.match(/@@({.+?})@@/g).reverse().map((e) =>

myApimain.tsx1 match

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

doublemain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function double(x: number) {
2 return 2 * x;
3}

openAqNowcastAQImain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export async function openAqNowcastAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +

testThisExpressUrlmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { thisExpressURL } from "https://esm.town/v/stevekrouse/thisExpressURL";
2
3export function testThisExpressUrl(req, res) {
4 let url = thisExpressURL();
5 res.send(`<a href="${url}">${url}</a>`);

fetchHTMLmain.tsx2 matches

@stevekrouse•Updated 1 year ago
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3
4// this function doesn't work yet, I'm still iterating on it
5export function fetchHTML(url: string, options?: any) {
6 return fetchText(url, options)
7 .then(parseHTML);

hnTopTenStoriesmain.tsx1 match

@iakovos•Updated 1 year ago
3
4// Get the title of the top story on Hacker News
5export async function hnTopTenStories() {
6 const topStories: Number[] = await fetch(
7 "https://hacker-news.firebaseio.com/v0/beststories.json?print=pretty",

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.