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/$%7Burl%7D?q=function&page=2451&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 26300 results for "function"(3672ms)

getWeathermain.tsx1 match

@chet•Updated 1 year ago
3
4/** Must set process.env.WEATHER_API_KEY for weatherapi.com **/
5export async function getWeather(
6 query: string,
7 days = 10,

greenhouseToRSSmain.tsx1 match

@donmccurdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function greenhouseToRSS(req: Request) {
4 const { Feed } = await import("npm:feed");
5 const searchParams = new URL(req.url).searchParams;

leverToRSSmain.tsx1 match

@donmccurdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function leverToRSS(req: Request) {
4 const { Feed } = await import("npm:feed");
5 const { XMLParser } = await import("npm:fast-xml-parser");

createValmain.tsx1 match

@neverstew•Updated 1 year ago
30}
31
32export function createVal({ token, code, name, readme, privacy }: CreateValArgs): Promise<ValResponse> {
33 const body: Record<string, unknown> = {
34 code,

updateValByIDmain.tsx1 match

@nbbaier•Updated 1 year ago
11}
12
13export function updateValByID({ token, valId, code, name, readme, privacy }: UpdateValArgs): Promise<any> {
14 const body: Record<string, unknown> = {
15 token,

updateValByNamemain.tsx1 match

@nbbaier•Updated 1 year ago
7}
8
9export function updateValByName({ token, code, name }: UpdateValArgs): Promise<any> {
10 const body: Record<string, unknown> = {
11 token,

untitled_tanTickmain.tsx1 match

@hfu•Updated 1 year ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({
3 type: 'Feature',

notebookmain.tsx2 matches

@pomdtr•Updated 1 year ago
4import mime from "npm:mime@4.0.1";
5
6export function extractFiles(markdown: string): Record<string, string> {
7 const fileRegex = /^```(\w+)\s*(.*)\s*\n([\s\S]*?)```/gm;
8 const files: Record<string, string> = {};
18}
19
20export default async function(req: Request) {
21 const { pathname, search } = new URL(req.url);
22 const params = new URLSearchParams(search);

logMessagemain.tsx4 matches

@willthereader•Updated 1 year ago
3 const allowedLogLevels = ["error", "debug", "info", "warn"];
4
5 function logMessage(level, message) {
6 // console.log("logMessage function called");
7 // Check if the specified log level is allowed
8 if (allowedLogLevels.includes(level)) {
16 }
17
18 return logMessage; // Return the logMessage function for usage
19})();
20
21// Export the logMessage function for use in other modules
22export { logMessage };
23

constructReadTangleUrlmain.tsx1 match

@willthereader•Updated 1 year ago
1import { logMessage } from "https://esm.town/v/willthereader/logMessage";
2
3// Immediately invoked function that exports a function generating a URL as a string,
4// which fetches all comments from an article associated with the provided post_id.
5export const constructReadTangleUrl = (() => {

getFileEmail4 file matches

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

tuna8 file matches

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