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=2066&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 22581 results for "function"(2857ms)

maroonLynxmain.tsx1 match

@liamdanielduffy•Updated 1 year ago
2 [key: string]: string;
3};
4export async function parseCalendarEventsTable(html: string): Promise<TableRow[]> {
5 const { DOMParser } = await import(
6 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"

submitPRREADME.md1 match

@nbbaier•Updated 1 year ago
20## Parameters
21
22The function takes two parameters: your gh access token and an object that's identical to the object submitted to the gh API. See [GH's documentation](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request) for more info!
23
24

aliasmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
4 const username = params.username;
5 let url = `https://api.val.town/v1/alias/${username}`;

ssr_react_minimain.tsx1 match

@stevekrouse•Updated 1 year ago
35
36export const hydrate = (importMetaURL: string) =>
37 async function(req: Request): Promise<Response> {
38 const { author, name } = extractValInfo(importMetaURL);
39 const valURL = `https://www.val.town/v/${author}/${name}`;

htmlREADME.md1 match

@postpostscript•Updated 1 year ago
30import { html, htmlResponse } from "https://esm.town/v/postpostscript/html";
31
32export default function(req: Request) {
33 return htmlResponse`
34 Request URL: ${decodeURIComponent(req.url)}

ssr_routerREADME.md3 matches

@pomdtr•Updated 1 year ago
8
9```ts
10export default function() {
11 <h1>Hello World!</h1>
12}
15Optionally, you can define an handler next to your component, allowing you to handle query params or form inputs.
16
17Use the `ctx.render` function to pass props to your component.
18
19```ts
24};
25
26export default function(props: {name?: string}) {
27 <h1>Hello { name || "World }!</h1>
28}

valToGHREADME.md2 matches

@nbbaier•Updated 1 year ago
1# valToGH
2
3A utility function for programmatically updating a GitHub repository with code retrieved from a Val.
4
5**NOTE**: This function currently does not change the contents of a file if it is already present. I will however be adding that functionality.
6
7## Usage

example_releasemain.tsx1 match

@pomdtr•Updated 1 year ago
1export default function(req) {
2 return new Response("dev");
3}

googlePhotosMarketingRSSmain.tsx2 matches

@Glench•Updated 1 year ago
2import { fetch } from "https://esm.town/v/std/fetch";
3
4async function getOfficialRedditPosts() {
5 const resp = await fetch("https://www.reddit.com/r/googlephotos/.json");
6 if (!resp.ok) return [];
12 return filtered_posts;
13}
14async function getGoogleSupportForumPosts() {
15 const resp = await fetch(
16 "https://support.google.com/photos/threads?hl=en&max_results=500",

todo_setup_tablemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite";
2
3export default async function() {
4 return sqlite.execute(`CREATE TABLE IF NOT EXISTS todos (
5 id INTEGER PRIMARY KEY AUTOINCREMENT,

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.