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=3&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 31478 results for "function"(7823ms)

Blob Storage414 words

https://docs.val.town/std/blob/
ValTownBlobError for unexpected errors. Utilities. Section titled “Utilities” Our Blob SDK also includes some utility functions to make working with blobs easier. Copy. Section titled “Copy” Copy import { blob

Sections

Utilities

Utilities. Section titled “Utilities” Our Blob SDK also includes some utility functions to make working with blobs easier.

JavaScript SDK427 words

https://docs.val.town/api/sdk/
to your package.json file. index.mjs import ValTown from "@valtown/sdk"; const valTown = new ValTown(); async function main() { const myProfile = await valTown.me.profile.retrieve(); console.log(myProfile); } main(); Finally, the API expects

Sections

Getting started in Node.js

to your package.json file. index.mjs import ValTown from "@valtown/sdk"; const valTown = new ValTown(); async function main() { const myProfile = await valTown.me.profile.retrieve(); console.log(myProfile); } main(); Finally, the API expects

AWS S3483 words

https://docs.val.town/integrations/s3/
Ask questions about this page. You can upload and download from AWS S3 inside val functions. In this guide, you’ll create an AWS bucket, an IAM user, and then test

Sections

AWS S3

Ask questions about this page. You can upload and download from AWS S3 inside val functions. In this guide, you’ll create an AWS bucket, an IAM user, and then test

Upgrading Legacy Vals513 words

https://docs.val.town/upgrading/legacy-vals/
Here’s how you can handle folders: Do nothing: Upgrade vals individually; they remain separate but functional. Manual consolidation: Upgrade the main val first, then manually copy & paste other vals’

Sections

Legacy Val Folders

Here’s how you can handle folders: Do nothing: Upgrade vals individually; they remain separate but functional. Manual consolidation: Upgrade the main val first, then manually copy & paste other vals’

Telegram bot584 words

https://docs.val.town/integrations/telegram/
of this guide, which makes the HTTP calls to telegram more directly with simpler helper function. 1. Create your bot. Section titled “1. Create your bot” Telegram has the best

Sections

Introduction

of this guide, which makes the HTTP calls to telegram more directly with simpler helper function.

Google Sheets1356 words

https://docs.val.town/integrations/google-sheets/
ACCOUNT ID HERE>"; const sheetID = "<YOUR SHEET ID HERE>"; const baseURL = `https://sheets.googleapis.com/v4/spreadsheets/${sheetID}/values`; async function fetchAccessToken() { const response = await fetch( `https://api.pipedream.com/v1/accounts/${accountID}?include_credentials=1`, { headers: { Authorization: `Bearer ${Deno.env.get("pipedream_api_key")}`,

Sections

6. Fetch a Google Sheets access token and use it in your val

ACCOUNT ID HERE>"; const sheetID = "<YOUR SHEET ID HERE>"; const baseURL = `https://sheets.googleapis.com/v4/spreadsheets/${sheetID}/values`; async function fetchAccessToken() { const response = await fetch( `https://api.pipedream.com/v1/accounts/${accountID}?include_credentials=1`, { headers: { Authorization: `Bearer ${Deno.env.get("pipedream_api_key")}`,

Discord bot692 words

https://docs.val.town/integrations/discord/how-to-make-a-discord-bot-hosted-24-7-for-free-in-/
is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces of data — all from the browser and

Sections

Step 3: Login to Val Town

is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces of data — all from the browser and

Permissions935 words

https://docs.val.town/reference/permissions/
Town Discord notification. // Translates one kind of webhook (Clerk) into another (Discord). export async function handleDiscordNewUser(req: express.Request, res) { // check custom auth secret sent from clerk. if (req.get("auth")

Sections

Custom Authentication

Town Discord notification. // Translates one kind of webhook (Clerk) into another (Discord). export async function handleDiscordNewUser(req: express.Request, res) { // check custom auth secret sent from clerk. if (req.get("auth")

currentDateAndTimetime.ts1 match

@jamiedubs•Updated 10 hours ago
4 * Accepts both IANA names (America/New_York) and common abbreviations (ET, EDT, EST, PT, etc.)
5 */
6export default async function(req: Request): Promise<Response> {
7 const url = new URL(req.url);
8 const tz = url.searchParams.get('tz') || 'UTC';

image-sliderscript.js7 matches

@ivobg•Updated 11 hours ago
5showSlides(SLIDEINDEX);
6
7function showSlides(index) {
8 // get slides html and dots
9 let slides = document.querySelectorAll(".slide"),
26
27// event on prev arrow
28document.querySelector("#arrow-prev").addEventListener("click", function() {
29 showSlides(--SLIDEINDEX);
30});
31
32// event on next arrow
33document.querySelector("#arrow-next").addEventListener("click", function() {
34 showSlides(++SLIDEINDEX);
35});
36
37// event on dots
38document.querySelectorAll(".dot-navigation").forEach(function(elem) {
39 elem.addEventListener("click", function() {
40 // get index of the dot
41 let nodes = Array.prototype.slice.call(this.parentElement.children),
42 dotIndex = nodes.indexOf(elem);
43
44 // call the function for the index of clicked dot
45 showSlides(SLIDEINDEX = dotIndex);
46 });
48
49// automatic slideshow
50setInterval(function() {
51 showSlides(++SLIDEINDEX);
52}, 10000);
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.