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=1514&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 17236 results for "function"(1101ms)

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

aqimain.tsx1 match

@djf•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 });

foc_contactmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export default async function(e: Email) {
4 email({
5 subject: "Future of Coding Message: " + e.subject,

lit_examplemain.tsx1 match

@pomdtr•Updated 1 year ago
4`;
5
6export default function(req: Request) {
7 return new Response(html, {
8 headers: {

codemirror_web_componentmain.tsx1 match

@pomdtr•Updated 1 year ago
15</html>`;
16
17export default function(req: Request) {
18 return new Response(
19 html,

lit_example_componentmain.tsx1 match

@pomdtr•Updated 1 year ago
18 }
19
20 // Render the UI as a function of component state
21 render() {
22 return html`<p>Hello, ${this.name}!</p>`;

lua_wasi_examplemain.tsx1 match

@vladimyr•Updated 1 year ago
5print("Hello world")
6
7function sum(a, b)
8 return a + b
9end

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