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=2134&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 22656 results for "function"(4966ms)

myApimain.tsx1 match

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

createIssuemain.tsx1 match

@andy_blum•Updated 1 year ago
1import process from "node:process";
2
3export async function createIssue(issue_data) {
4 const { Octokit } = await import("npm:@octokit/core");
5 const octokit = new Octokit({

hnFollowPollJobmain.tsx1 match

@timwee•Updated 1 year ago
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
4
5export async function hnFollowPollJob({ lastRunAt }) {
6 let posts = await hnLatestPosts({
7 authors: hackerNewsAuthors,

dotProductmain.tsx1 match

@wilt•Updated 1 year ago
1export function dotProduct(vec1: number[], vec2: number[]): number {
2 let sum = 0;
3 for (let i = 0; i < vec1.length; i++) {

functionZillamain.tsx1 match

@sdan•Updated 1 year ago
1import { extractValArgs } from "https://esm.town/v/sdan/extractValArgs";
2
3export async function functionZilla(fnc: string) {
4 let args = await extractValArgs(fnc);
5 console.log(args);

githubNormalizedJsonStringmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function githubNormalizedJsonString(payload: object) {
2 // GitHub sends its JSON with an indentation of 2 spaces and a line break at the end
3 const payloadString = JSON.stringify(payload, null, 2) + "\n";

timedmain.tsx1 match

@stevekrouse•Updated 1 year ago
1// Times how long an execution takes
2// usage: @stevekrouse.panphoraDistanceTimed
3export async function timed(f) {
4 const start = Date.now();
5 const res = await f();

measureValTownE2emain.tsx1 match

@stevekrouse•Updated 1 year ago
26 }
27 console.log(
28 `average e2e user function time: ${
29 (userFuncTimes.reduce((a, b) => a + b, 0) / count).toFixed(0)
30 }ms (fastest was ${

addmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function add(...args) {
2 return args.reduce((a, b) => a + b, 0);
3}

dmmain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function dm(message, auth) {
6 let { handle, error } = await verifyAPIAuth(auth);
7 if (!handle)

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.