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=1597&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 18856 results for "function"(2027ms)

tealBadgermain.tsx1 match

@stevekrouse•Updated 10 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2export default async function(req: Request): Promise<Response> {
3 const openai = new OpenAI();
4 const stream = await openai.chat.completions.create({

testCodemirrorTsBrowserEmacsmain.tsx2 matches

@saolsen•Updated 11 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request): Promise<Response> {
5 return new Response(
6 renderToString(
11 {`let hasAnError: string = 10;
12
13function increment(num: number) {
14 return num + 1;
15}

openAIStreamingExamplemain.tsx1 match

@stevekrouse•Updated 11 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function(req: Request): Promise<Response> {
4 const openai = new OpenAI();
5 const stream = await openai.chat.completions.create({

robPikeIOmain.tsx1 match

@stevekrouse•Updated 11 months ago
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 new ReadableStream({

sapphireThrushmain.tsx1 match

@iamseeley•Updated 11 months ago
1export default async function handler(req: Request): Promise<Response> {
2 const resumeDetails = {"basics":{"name":"James Thomas Seeley","label":"Web Developer","image":"","email":"hello@tseeley.com","phone":"","url":"https://tseeley.com","summary":"","location":{"address":"","postalCode":"","city":"","countryCode":"","region":""},"profiles":[{"network":"GitHub","username":"iamseeley","url":""},{"network":"LinkedIn","username":"James Thomas Seeley","url":""}]},"work":[{"name":"Wando","position":"Web Developer","url":"","startDate":"2022","endDate":"present","summary":"","highlights":["Crafted an event management platform with secure authentication and full CRUD capabilities, streamlining client operations","Created an interactive public website to display events and menu items, incorporating a user-friendly interface for online inquiries","Developed a responsive and accessibility-focused website for a law firm, resulting in a 20% increase in client inquiries"]},{"name":"Mindpool","position":"Business Strategy Intern","url":"","startDate":"2022","endDate":"2022","summary":"","highlights":["Built a category defining, business to business growth strategy focused on ESG"]}],"volunteer":[],"education":[{"institution":"Tickle College of Engineering - University of Tennessee, Knoxville","url":"","area":"Computer Science","studyType":"M.S.","startDate":"","endDate":"2025","score":"","courses":[]},{"institution":"Haslam College of Business - University of Tennessee, Knoxville","url":"","area":"Business Administration","studyType":"B.S.","startDate":"","endDate":"2023","score":"cum laude","courses":[]},{"institution":"Danish Institute for Study Abroad","url":"","area":"Innovation and Entrepreneurship in Europe","studyType":"","startDate":"","endDate":"2022","score":"","courses":[]}],"awards":[],"publications":[],"skills":[{"name":"Web Development","level":"","keywords":["HTML5","CSS","Tailwind CSS","React","Next.js","Vite"]},{"name":"Programming","level":"","keywords":["JavaScript","TypeScript","Python","Go"]},{"name":"Tools & Software","level":"","keywords":["Git","Docker","Figma","Adobe Suite","Excel"]}],"languages":[],"interests":[],"references":[],"projects":[{"name":"wando-ui","startDate":"","endDate":"2023","description":"Component collection and CLI application written in TypeScript","highlights":["Designed and implemented composable styles using Tailwind CSS, clsx, and class-variance-authority, enhancing modularity and scalability","Developed a publicly available CLI tool leveraging Node.js for efficient package management and script execution, allowing users to import components easily into their own projects"],"url":"https://github.com/iamseeley/wando-ui"},{"name":"go-forth","startDate":"","endDate":"2023","description":"Static site generator written in Go","highlights":["Engineered a static site generator featuring Markdown-to-HTML conversion, YAML front matter parsing, automated build processes, and efficient content caching, optimizing performance"],"url":"https://github.com/iamseeley/go-forth2.0"}],"certificates":[{"name":"BootDev, JavaScript, Python, Algorithms","date":"2023","issuer":"","url":""},{"name":"SuperHi, Foundation, HTML, CSS + Javascript","date":"2022","issuer":"","url":""}]};
3 return new Response(JSON.stringify(resumeDetails), {

purpleGrousemain.tsx1 match

@stevekrouse•Updated 11 months ago
1export default async function(req: Request): Promise<Response> {
2 const { readable, writable } = new TransformStream();
3 const writer = writable.getWriter();

copyToClipmain.tsx1 match

@iamseeley•Updated 11 months ago
1export function copyToClip(elementId) {
2 const element = document.querySelector(`#${elementId}`);
3 if (element) {

convertToResumeJSONmain.tsx1 match

@iamseeley•Updated 11 months ago
3const tokenBucket = new TokenBucket(5, 1/12);
4
5export async function convertToResumeJSON(resume, apiKey) {
6 if (!tokenBucket.consume()) {
7 throw new Error("Rate limit reached. Please try again later.");

websiteHasChangedmain.tsx1 match

@charlypoly•Updated 11 months ago
7import slugify from "npm:slugify";
8
9export async function hasWebsiteChanged(url: string, threshold = 0.5) {
10 const slug = slugify(url);
11

browserbaseUtilsmain.tsx2 matches

@charlypoly•Updated 11 months ago
5}
6
7export async function loadPageContent(url: string, options: LoadPageOptions = { textContent: false }) {
8 const browser = await puppeteer.connect({
9 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
35}
36
37export async function screenshotPage(url: string, options: ScreenshotOptions = { fullPage: true }) {
38 const browser = await puppeteer.connect({
39 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,

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