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=1730&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 17350 results for "function"(2162ms)

chatSampleFunctionSingleREADME.md1 match

@webup•Updated 1 year ago
1Migrated from folder: openai/samples/functions/chatSampleFunctionSingle

thisExpressURLREADME.md1 match

@stevekrouse•Updated 1 year ago
6
7```js
8function testThisExpressUrl(req, res) {
9 let url = @stevekrouse.thisExpressURL();
10 res.send(`<a href="${url}">${url}</a>`);

publishYoutubeToLemmyREADME.md1 match

@pdebie•Updated 1 year ago
6
7```typescript
8async function publishMyFeed() {
9 try {
10 return @pdebie.publishYoutubeToLemmy({

resyBotREADME.md1 match

@vtdocs•Updated 1 year ago
11import { email } from "https://esm.town/v/std/email?v=13";
12
13export default async function (interval: Interval) {
14 const bookingInfo = await resyBot( {
15 slug: 'amaro-bar',

pugREADME.md1 match

@wilt•Updated 1 year ago
1# Pug HTML Template Renderer
2This function is equivalent to [`pug.render`](https://pugjs.org/api/reference.html#pugrendersource-options-callback) - it takes a Pug template string and renders it to an HTML string. `import(npm:pug)` doesn't work in Val.Town due to Pug's usage of `new Function`, which is forbidden for security reasons, so this function uses Val.Town's `eval` API instead.
3
4## Example

getTopPlayersByScoreREADME.md2 matches

@ktodaz•Updated 1 year ago
1Welcome ESPT, this is the function that sorts and scores every player.
2
3This function will remain public so if things ever change you can see updates
4
5Migrated from folder: hll/high_score_script/getTopPlayersByScore

sendDiscordMessageREADME.md3 matches

@ktodaz•Updated 1 year ago
1# Send Chunked Discord Message
2This function is used to send a message to a Discord webhook. If the message exceeds the maximum character limit (2000 characters), it will be divided into chunks and sent as multiple messages.
3
4### Parameters
5message (string): The message to be sent to the Discord webhook.
6### Return Value
7This function does not return any value.
8
9## Example Usage:
13await @ktodaz.sendDiscordMessage(message);
14```
15In the above example, the sendDiscordMessage function is used to send the message to the Discord webhook. If the message exceeds 2000 characters, it will be split into smaller chunks and sent as separate messages.
16
17## Required Secrets:

flightRadar24README.md1 match

@raylu•Updated 1 year ago
1usage:
2```js
3async function example() {
4 const discordUserId = "713159744516259880";
5 await @raylu.flightRadar24(

verify_discord_signatureREADME.md2 matches

@mattx•Updated 2 years ago
5- signature should be the X-Signature-Ed25519 header
6- timestamp should be the X-Signature-Timestamp header
7You **must** return a 401 error and return early if this function returns false, otherwise you will pretty quickly get a big scary warning from Discord that your endpoint has been removed. Note that you'll only be able to add one once you've integrated this correctly.
8
9As this function only deals with strings, it doesn't matter whether you use an Express or web endpoint.
10
11Migrated from folder: discord/verify_discord_signature

messageMeREADME.md1 match

@demo•Updated 2 years ago
1Migrated from folder: functions/messageMe

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",