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=1676&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 17296 results for "function"(2261ms)

notifyNewBymain.tsx2 matches

@stevekrouse•Updated 1 year ago
4// Customizable notifications for customizable content for a customizable new criteria
5// Example usage: @stevekrouse.dateMeNotify
6export function notifyNewBy<A>({ getData, isNew, notify, name }: {
7 getData: (d?: Date) => A[] | Promise<A[]>;
8 isNew: (params: {
13 name?: string;
14}) {
15 return async function ({ lastRunAt }: Interval) {
16 const data = await getData(lastRunAt);
17 let newData = data.filter((data) => isNew({ data, lastRunAt }));

myApimain.tsx1 match

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

myApimain.tsx1 match

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

renderTopStoriesmain.tsx1 match

@iakovos•Updated 1 year ago
1import { getUrlHostname } from "https://esm.town/v/iakovos/getUrlHostname";
2
3export function renderTopStories(stories: {
4 id: number;
5 title: string;

questionsWithGuidelinesChainmain.tsx1 match

@jacoblee93•Updated 1 year ago
37 .pipe(new StringOutputParser());
38 // RunnableSequence.from() is equivalent to `.pipe().pipe()`
39 // but will coerce objects (and functions) into runnables
40 const questionStyleChain = RunnableSequence.from([
41 {

currentCommuteAlertMessagesmain.tsx1 match

@roop•Updated 1 year ago
2import { fetchAlerts } from "https://esm.town/v/roop/fetchAlerts";
3
4export async function currentCommuteAlertMessages() {
5 const alerts = (await fetchAlerts()).entity;
6 const filtered = filterAlertsByLineAndStation(alerts);

myApimain.tsx1 match

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

myApimain.tsx1 match

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

getLemmyPostsmain.tsx2 matches

@pdebie•Updated 1 year ago
1// This tries to fetch a specific post on multiple Lemmpy instances
2// and can try to fix missing comments on a specific instance.
3export async function getLemmyPosts(instance: string, communityName: string) {
4 const { LemmyHttp } = await import("npm:lemmy-js-client");
5 let client = new LemmyHttp(`https://${instance}`, {
6 fetchFunction: fetch,
7 });
8 const { posts } = await client.getPosts({

api500main.tsx1 match

@matthamlin•Updated 1 year ago
1export function api500(req: express.Request, res: express.Response) {
2 res.status(503);
3 res.json({

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 week 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.