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=1631&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 18400 results for "function"(3136ms)

aqimain.tsx1 match

@djf•Updated 1 year ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export async function aqi(interval: Interval) {
5 const location = "brooklyn navy yard"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

foc_contactmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export default async function(e: Email) {
4 email({
5 subject: "Future of Coding Message: " + e.subject,

lit_examplemain.tsx1 match

@pomdtr•Updated 1 year ago
4`;
5
6export default function(req: Request) {
7 return new Response(html, {
8 headers: {

codemirror_web_componentmain.tsx1 match

@pomdtr•Updated 1 year ago
15</html>`;
16
17export default function(req: Request) {
18 return new Response(
19 html,

lit_example_componentmain.tsx1 match

@pomdtr•Updated 1 year ago
18 }
19
20 // Render the UI as a function of component state
21 render() {
22 return html`<p>Hello, ${this.name}!</p>`;

lua_wasi_examplemain.tsx1 match

@vladimyr•Updated 1 year ago
5print("Hello world")
6
7function sum(a, b)
8 return a + b
9end

globalDocumentmain.tsx1 match

@easrng•Updated 1 year ago
72 "SVGFEFuncBElement",
73 "HTMLBRElement",
74 "SVGComponentTransferFunctionElement",
75 "HTMLOutputElement",
76 "HTMLMarqueeElement",

buttonmain.tsx2 matches

@easrng•Updated 1 year ago
1import { upgradeExpress } from "https://esm.town/v/easrng/upgradeExpress";
2async function inlineUrls(cssString) {
3 const urlRegex = /url\(['"]?(.*?)['"]?\)/g;
4 let result = cssString;
19import esc from "npm:escape-html@1.0.3";
20import { init } from "npm:server-text-width@1.0.2";
21export const button = upgradeExpress(async function button(req) {
22 const { getTextWidth } = init(
23 IBMPlexSansMetrics,

upgradeExpressmain.tsx1 match

@easrng•Updated 1 year ago
1export const upgradeExpress = (handler: (request: Request) => Response | PromiseLike<Response>) =>
2 function(request: Request | express.Request, response?: express.Response): Response | Promise<Response> {
3 if (request instanceof Request) {
4 const response = handler(request);

upgradeExpressREADME.md1 match

@easrng•Updated 1 year ago
3
4## How it works
5`upgradeExpress` wraps a Web handler into a function that works as normal when called by the Web API, and redirects to the Web API when called by the Express API.
6
7## Example

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
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.