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=825&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 8323 results for "function"(474ms)

dlockmain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { parentReference } from "https://esm.town/v/stevekrouse/parentReference";
4
5export async function dlock({ id, ttl, release, lease }: {
6 id?: string;
7 ttl?: number;

updateThreadsafeStateExmain.tsx1 match

@stevekrouse•Updated 1 year ago
1let { threadsafeStateEx } = await import("https://esm.town/v/stevekrouse/threadsafeStateEx");
2
3export async function updateThreadsafeStateEx({ lease, state }) {
4 // TODO confirm it's me updating the state using auth
5 if (lease > threadsafeStateEx.lease) {

webassemblyExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
14 const importObj = {};
15 const { instance } = await WebAssembly.instantiate(source.buffer, importObj);
16 const addTwo = instance.exports.addTwo as CallableFunction;
17 return addTwo(20, 31);
18})();

svgAnimationmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function svgAnimation(req: express.Request, res: express.Response) {
2 res.set("content-type", "image/svg+xml");
3 res.end(`<svg

tmain.tsx1 match

@tmcw•Updated 1 year ago
1import { h } from "https://esm.town/v/tmcw/h";
2
3export function t(tag: string, args: any = {}, children: any[] = []) {
4 const func = (...argsOrChildren: any) => {
5 if (Array.isArray(argsOrChildren[0]))

big_story_visualizationmain.tsx1 match

@tmcw•Updated 1 year ago
47
48
49 function render() {
50 const width = window.innerWidth;
51 const output = Plot.plot({

cloudmailinmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function cloudmailin(req, res) {}

devNullmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function devNull(...args: any[]) {
2 return null;
3}

testEmailmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { testEmails } from "https://esm.town/v/stevekrouse/testEmails";
3
4export function testEmail(e: {
5 from: string;
6 to: string[];

rssDemo1main.tsx1 match

@stevekrouse•Updated 1 year ago
3import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems";
4
5export async function rssDemo1(interval) {
6 const items = await newRSSItems({
7 url: inkAndSwitchRssUrl,

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago