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/$%7Bsuccess?q=function&page=1776&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 18199 results for "function"(2287ms)

shufflemain.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function shuffle(a) {
2 const { default: shuffle } = await import("npm:lodash");
3 return shuffle(a);

dataToRSSmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export const dataToRSS = function (data: Item[], settings: Setting) {
2 let { title, link, description, rssLink } = settings;
3 let rss = [

expressHTMLExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
1// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
2export async function expressHTMLExample(
3 req: express.Request,
4 res: express.Response,

parseHTMLmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function parseHTML(text) {
2 const { DOMParser } = await import(
3 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"

mtmain.tsx4 matches

@stevekrouse•Updated 1 year ago
32 <script src="https://cdn.moderntreasury.com/compliance/v1/mt-onboarding.js"></script>
33 <script type="application/ecmascript">
34 function openIframe() {
35 const onSuccess = function (event) {
36 // handle success event (e.g. move user to the next step of your flow following KYC)
37 };
38
39 const onError = function (event) {
40 // handle error event (e.g. open the iframe again)
41 };
42
43 const onCancel = function (event) {
44 // handle cancel event (e.g. email the user later to try and reactivate them)
45 // note: this event will not be triggered if the user closes their browser.

myApimain.tsx1 match

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

testHTMLmain.tsx1 match

@sairamoe•Updated 1 year ago
1export function testHTML(req: express.Request, res: express.Response) {
2 res.send(
3 "<html lang='en'>" +

pollRssmain.tsx1 match

@hipstersmoothie•Updated 1 year ago
1import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
2
3export async function pollRss({ lastRunAt }) {
4 const items = await newRSSItems({
5 url: "https://inkandswitch.com/index.html",

myApimain.tsx1 match

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

measureValTownE2emain.tsx1 match

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

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",