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/$%7Bart_info.art.src%7D?q=function&page=1656&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 18733 results for "function"(3135ms)

dateme_layoutmain.tsx1 match

@stevekrouse•Updated 1 year ago
4const tabs = { "/": "Home", "/browse": "Browse", "/faq": "FAQ" };
5
6export default function({ activeTab, children }: PropsWithChildren<{ activeTab: string }>) {
7 return (
8 <html>

dateme_homemain.tsx1 match

@stevekrouse•Updated 1 year ago
4import Layout from "https://esm.town/v/stevekrouse/dateme_layout";
5
6export default function Home(c) {
7 return c.html(
8 <Layout activeTab={new URL(c.req.url).pathname}>

tanChimpanzeemain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { reloadOnSaveMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
3
4export default reloadOnSaveMiddleware(async function(req: Request): Promise<Response> {
5 return html(`<h1>Hello 3!!</h1>`);
6});

ReloadScriptmain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { parentReference } from "https://esm.town/v/stevekrouse/parentReference";
4
5export const reloadOnVals = async function(vals: { userHandle: string; valName: string }[]) {
6 const valVersions = await Promise.all(vals.map(getCurrentValVersionNumber));
7 // console.log("initialValVersions: ", valVersions);

getCurrentValVersionNumbermain.tsx1 match

@stevekrouse•Updated 1 year ago
4 * @param {string} valSlug - ie "username/valname"
5 */
6export async function getCurrentValVersionNumber({ name, handle }) {
7 const { version } = await alias({ username: handle, valName: name });
8 return version;

reloadOnSaveREADME.md1 match

@stevekrouse•Updated 1 year ago
9import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
10
11export default reloadOnSaveFetchMiddleware(async function(req: Request): Promise<Response> {
12 return html(`<h1>Hello!!</h1>`);
13})

JokeGeneratormain.tsx1 match

@samarthpasala•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

octopusAgilePricingmain.tsx1 match

@MattieTK•Updated 1 year ago
14 results: OctopusPrice[];
15};
16export async function octopusAgilePricing(location: string): Promise<OctopusPrice> {
17 const locationMap = {
18 "London": "C",

plumGazellemain.tsx1 match

@lufafajoshua•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
4 key: string;
5 event: string;
1export default async function handler(request: Request) {
2 if (request.method === "GET") {
3 return new Response(
9 <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.3/dist/tailwind.min.css" rel="stylesheet">
10 <script>
11 function handleSubmit(event) {
12 event.preventDefault();
13 var dreamInput = document.getElementById('dreamInput');

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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": "*",