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=2929&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 31522 results for "function"(22507ms)

TODO_tootLatestPostsmain.tsx2 matches

@jaandrle•Updated 1 year ago
3
4const found = new Set();
5export async function tootLatestPosts(interval: Partial<Interval>) {
6 const { lastRunAt = "2023-04-04T00:00:00" } = interval || {};
7 const lastRunDate = new Date(lastRunAt);
25import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
26import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
27function fetchRSS(url) {
28 return fetchText(url)
29 .then(parseXML)

pipemain.tsx3 matches

@jaandrle•Updated 1 year ago
1/**
2 * Composes multiple functions into a single function that passes the result of each function to the next
3 *
4 * @param {...Function} funs The functions to compose
5 * @returns {Function} A function that represents the composed functions
6 */
7export const pipe = (...funs) =>

fireworks_ai_proxymain.tsx2 matches

@taras•Updated 1 year ago
10};
11
12function err(msg): Response {
13 return new Response(
14 JSON.stringify({
28}
29
30export default async function(req: Request): Promise<Response> {
31 const url = new URL(req.url);
32 const pathname = url.pathname;

cors_proxymain.tsx1 match

@taras•Updated 1 year ago
6};
7
8export default async function(req: Request): Promise<Response> {
9 // Check if the request is an OPTIONS request
10 if (req.method === "OPTIONS") {

getHashForUrlmain.tsx1 match

@vladimyr•Updated 1 year ago
2
3// Retrieves the URL, and returns a hash of its contents.
4export async function getHashForUrl(url: string): Promise<string> {
5 // Fetch the content from the URL
6 const response = await fetch(url);

fetch_docsmain.tsx2 matches

@andreterron•Updated 1 year ago
2
3/**
4 * Wraps the JavaScript Fetch function to anonymize where the request is
5 * coming from ([Docs ↗](https://docs.val.town/std/fetch))
6 *
9 * method, headers, etc) ([Docs ↗](https://deno.land/api@v1.42.1?s=RequestInit))
10 */
11export async function fetch(input: string | URL | Request, requestInit?: RequestInit) {
12 const origReq = new Request(input, requestInit);
13 const url = new URL("/v1/fetch", API_URL);

fetchmain.tsx2 matches

@vladimyr•Updated 1 year ago
2
3/**
4 * Wraps the JavaScript Fetch function to anonymize where the request is
5 * coming from ([Docs ↗](https://docs.val.town/std/fetch))
6 *
9 * method, headers, etc) ([Docs ↗](https://deno.land/api@v1.42.1?s=RequestInit))
10 */
11export async function fetch(input: string | URL | Request, requestInit?: RequestInit) {
12 const origReq = new Request(input, requestInit);
13 const url = new URL("/v1/fetch", API_URL);
3import { email } from "https://esm.town/v/std/email?v=12";
4
5export default async function(interval: Interval) {
6 const dynamiclandWebsiteHash = await blob.getJSON("dynamiclandWebsiteHash");
7 const newHash = await getHashForUrl("https://dynamicland.org/");

getHashForUrlmain.tsx1 match

@janpaul123•Updated 1 year ago
3
4// Retrieves the URL, and returns a hash of its contents.
5export async function getHashForUrl(url: string): Promise<string> {
6 // Fetch the content from the URL
7 const response = await fetch(url);

fetchmain.tsx2 matches

@std•Updated 1 year ago
3
4/**
5 * Wraps the JavaScript Fetch function to anonymize where the request is
6 * coming from ([Docs ↗](https://docs.val.town/std/fetch))
7 *
10 * method, headers, etc) ([Docs ↗](https://deno.land/api@v1.42.1?s=RequestInit))
11 */
12export async function fetch(input: string | URL, requestInit?: RequestInit) {
13 let query = new URLSearchParams({
14 url: input.toString(),
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks 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.