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=1751&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 18465 results for "function"(2319ms)

parseFigmaURLmain.tsx1 match

@rodrigotello•Updated 1 year ago
1export function parseFigmaURL(url) {
2 const regex = /^https:\/\/www.figma.com\/file\/([^/]+)\/([^/?]+)(\?[^/#]+)?/;
3 const match = url.match(regex);

welcomeEmailmain.tsx1 match

@rodrigotello•Updated 1 year ago
9 <h3>What is a val?</h3>
10 <p>A val is small JavaScript or TypeScript snippet of code, written in the browser and run in our servers.
11Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.<p>
12 </li>
13

peelSessionArtistSessionsmain.tsx1 match

@aeaton•Updated 1 year ago
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
2
3export async function peelSessionArtistSessions(url) {
4 const dom = await fetchHtmlDom(url);
5 const list = dom.querySelector(".link-list");

myApimain.tsx1 match

@paulwilkinson•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

runnermain.tsx1 match

@ant•Updated 1 year ago
1export function runner(req, resp) {
2 console.log(req);
3 console.log(resp);

nytmain.tsx1 match

@baj•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export async function nyt(req: express.Request, res: express.Response) {
4 const data = await fetchText(
5 "https://cn.nytimes.com/",

valCanvasmain.tsx1 match

@liamdanielduffy•Updated 1 year ago
1import { valCanvasHTML } from "https://esm.town/v/liamdanielduffy/valCanvasHTML";
2
3export async function valCanvas(req: express.Request, res: express.Response) {
4 res.set("Content-Type", "text/html");
5 res.send(valCanvasHTML);

snakeToTitleCasemain.tsx1 match

@rwev•Updated 1 year ago
1export function snakeToTitleCase(str) {
2 return str
3 .split("_")

runmain.tsx1 match

@marianoguerra•Updated 1 year ago
1export async function run(req: express.Request, res: express.Response) {
2 let c = (
3 s,

myApimain.tsx1 match

@wesbos•Updated 1 year ago
1import { guestCount } from "https://esm.town/v/wesbos/guestCount";
2
3export function myApi(name) {
4 return "hi" + guestCount;
5}

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
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.