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/$%7Burl%7D?q=function&page=2645&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 29089 results for "function"(1794ms)

blobImagesmain.tsx1 match

@stevekrouse•Updated 1 year ago
7import { Hono } from "npm:hono@3";
8
9function esmTown(url) {
10 return fetch(url, {
11 headers: {

uploadImagemain.tsx2 matches

@easrng•Updated 1 year ago
4 * @returns {string} - uploaded image url
5 */
6export async function uploadImage(image: Blob): Promise<string> {
7 const fd = new FormData();
8 fd.append(
23 return data.result.variants[0];
24}
25async function getUploadURL(): Promise<string> {
26 const data = await (await fetch("https://www.val.town/api/trpc/generateImageUploadUrl", {
27 "headers": {

grayLimpetmain.tsx1 match

@samk•Updated 1 year ago
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");

currencymain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3function fetchJSON(url) {
4 return fetch(url).then(res => res.json());
5}

btcPriceAlertmain.tsx1 match

@samk•Updated 1 year ago
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "eth");

pyodideSquaremain.tsx1 match

@iamseeley•Updated 1 year ago
17
18 <script>
19 async function main() {
20 let pyodide = await loadPyodide();
21 console.log('Pyodide is ready to use!');

Candlewood_Lake_Temp_Alertsmain.tsx2 matches

@samk•Updated 1 year ago
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4
5export default async function(interval: Interval) {
6 const lastLakeTemp = await blob.getJSON("lastLakeTemp");
7 const temperature = await getLakeTemp();
43}
44
45export async function getLakeTemp() {
46 const result = await fetchText("https://www.omniafishing.com/w/candlewood-lake-3-fishing-reports/current-conditions");
47 const temperature = result.match(/<strong>([0-9]+)/)[1];
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4
5export default async function(interval: Interval) {
6 const lastLakeTemp = await blob.getJSON("lastLakeTemp");
7 const temperature = await getLakeTemp();
43}
44
45export async function getLakeTemp() {
46 const result = await fetchText("https://www.omniafishing.com/w/candlewood-lake-3-fishing-reports/current-conditions");
47 const temperature = result.match(/<strong>([0-9]+)/)[1];

unawaitedAsyncExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function handle() {
2 // Schedule work to do later
3 (async () => {

tanCranemain.tsx1 match

@frmysantana•Updated 1 year ago
1import cheerio from "npm:cheerio";
2
3export default async function tacoBellNutritionScrapper(req) {
4 const sourceUrl = `https://www.nutritionix.com/taco-bell/menu/premium`;
5 const siteText = await fetch(sourceUrl);
tuna

tuna9 file matches

@jxnblk•Updated 23 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.