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/image-url.jpg%20%22Image%20title%22?q=function&page=2147&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 22865 results for "function"(2261ms)

getPublicKeymain.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function getPublicKey(handle) {
2 let { publicKey } = await import(`/v/${handle}/publicKey`);
3 return publicKey;

runValAPImain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function runValAPI(name, ...args) {
2 return fetch(`https://api.val.town/v1/run/${name.replace("@", "")}`, {
3 method: "POST",

tursomain.tsx1 match

@std•Updated 1 year ago
5type createClient = Awaited<ReturnType<typeof tursoImport>>["createClient"];
6
7export function turso(keys, handle?) {
8 let val = "@std.tursoAPI";
9 let f = (method) => (...args) =>
1import { synesthesiacounter } from "https://esm.town/v/politelyinvinciblepointer/synesthesiacounter";
2
3export function getsynesthesiacounter() {
4 return synesthesiacounter;
5}

vanPlatemain.tsx1 match

@pomdtr•Updated 1 year ago
1export function vanPlate() {
2 type Primitive = string | number | boolean | bigint;
3 interface Props {

saveToTanaREADME.md3 matches

@nbbaier•Updated 1 year ago
1# Save To Tana
2
3This val provides a function `saveToTana` allows the creation of nodes in [Tana](https://tana.inc/) via their [Input API](https://github.com/tanainc/tana-input-api-samples). The parameters are as follows:
4- **Token:** to access the Tana Input API, you must pass an API token to the function. Obtain an API token from the Tana app and save it as a secret in Val Town.
5- **Node:** the node that is created within Tana is passed as the second argument and must conform to the shape of an Input API node (see the [documentation](https://github.com/tanainc/tana-input-api-samples) on github for details.
6- **Target node:** optionally, you can specify a specific target node by passing a node ID to the function as it's third argument.
7
8## Example Usage

hnLatestJobsmain.tsx1 match

@yeskunall•Updated 1 year ago
28
29// Get upto (200) of the latest jobs posted on HN
30export async function hnLatestJobs() {
31 const jobStories: Number[] = await fetch(
32 "https://hacker-news.firebaseio.com/v0/jobstories.json",

parseForwardedEmailmain.tsx1 match

@andreterron•Updated 1 year ago
9}
10
11export function parseForwardedEmail(body: string, subject: string): {
12 forwarded: boolean;
13 message: string | null;

parseReplyEmailmain.tsx1 match

@andreterron•Updated 1 year ago
4const parser = new EmailReplyParser(MockRe2);
5
6export function parseReplyEmail(body: string) {
7 return parser.read(body);
8}

nodeJSDistmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import LZString from "npm:lz-string";
3
4export async function nodeJSDist(req: Request): Promise<Response> {
5 let url = new URL(req.url);
6 if (url.pathname === "/index.tab") {

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.