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=817&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 8322 results for "function"(544ms)

htmlToMarkdownmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { unescapeHtml } from "https://esm.town/v/stevekrouse/unescapeHtml";
2
3export async function htmlToMarkdown(str) {
4 let unescaped = await unescapeHtml(str);
5 return unescaped
1import { private_library_val } from "https://esm.town/v/stevekrouse/private_library_val";
2
3export function untitled_return_steverkrouse_secret() {
4 return private_library_val;
5}

hootsuiteNasamain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function hootsuiteNasa(req: express.Request, res: express.Response) {
4 const NASA_ROOT = "https://images-api.nasa.gov";
5 const alphaNumericSpaces = new RegExp("^[a-zA-Z0-9\\s-_]+$");

preactTestmain.tsx1 match

@tmcw•Updated 1 year ago
4 );
5 const html = htm.bind(h);
6 function Component() {
7 const [count, setCount] = useState(0);
8 return html`<div class="foo">${count}</div>`;

newJSJamMessagemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { jsJamMessages } from "https://esm.town/v/stevekrouse/jsJamMessages";
2
3export function newJSJamMessage(m) {
4 jsJamMessages.push(m);
5 console.email(m, "New message!");

livingmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { alive as alive2 } from "https://esm.town/v/stevekrouse/alive";
3
4export async function living(req: Request) {
5 let name = decodeURI(new URL(req.url).pathname.replace("/", ""));
6 let alive, error;

ratedLimitedFuncExmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { rateLimit } from "https://esm.town/v/stevekrouse/rateLimit";
2
3export function ratedLimitedFuncEx() {
4 if (!rateLimit("ratedLimitedFuncEx", 10))
5 return "Function exceeded rate limit";
6 return "Not yet rate limited!";
7}

lowercaseKeysmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function lowercaseKeys(object) {
2 return Object.fromEntries(
3 Object.entries(object).map(([k, v]) => [k.toLowerCase(), v]),

parseSendGridEmailsmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { parseSendGridEmail } from "https://esm.town/v/stevekrouse/parseSendGridEmail";
2
3export function parseSendGridEmails(input) {
4 if (!input) {
5 return undefined;

ab2strmain.tsx1 match

@stevekrouse•Updated 1 year ago
3from https://developer.chrome.com/blog/how-to-convert-arraybuffer-to-and-from-string/
4*/
5export function ab2str(buf) {
6 return String.fromCharCode.apply(null, new Uint8Array(buf));
7}

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago