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/$%7Bart_info.art.src%7D?q=function&page=2160&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 22454 results for "function"(3370ms)

d3ChordDiagrammain.tsx3 matches

@fil•Updated 1 year ago
1import { svgServer } from "https://esm.town/v/fil/svgServer";
2
3export async function d3ChordDiagram(req) {
4 // Import D3 and create a DOM document for server-side-rendering.
5 const d3 = await import("npm:d3");
22 // ======================================================
23 //
24 function chart(data) {
25 const width = 640;
26 const height = width;
100 return svg.node();
101 }
102 function groupTicks(d, step) {
103 const k = (d.endAngle - d.startAngle) / d.value;
104 return d3.range(0, d.value, step).map((value) => {

myApimain.tsx1 match

@willye•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

fetchImageAsBase64main.tsx1 match

@liamdanielduffy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchImageAsBase64(url) {
4 const response = await fetch(url);
5 const blob = await response.blob();

parseCalendarEventsTablemain.tsx1 match

@liamdanielduffy•Updated 1 year ago
2 [key: string]: string;
3};
4export async function parseCalendarEventsTable(html: string): Promise<TableRow[]> {
5 const { DOMParser } = await import(
6 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"

sha256main.tsx1 match

@vtdocs•Updated 1 year ago
1// Copied from https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
2export const sha256 = async function digestMessage(message) {
3 const msgUint8 = new TextEncoder().encode(message); // encode as (utf-8) Uint8Array
4 const hashBuffer = await crypto.subtle.digest("SHA-256", msgUint8); // hash the message

reactSSRExamplemain.tsx2 matches

@vtdocs•Updated 1 year ago
4 const ReactDOMServer = await import("npm:react-dom/server");
5 // Define some components
6 function TodoItem(props) {
7 return React.createElement("li", null, props.text);
8 }
9 function TodoList(props) {
10 const todoItems = props.items.map((item, index) =>
11 React.createElement(TodoItem, { key: index, text: item })

myApimain.tsx1 match

@eufracio•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@sudocss•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

thanksPiazzamain.tsx1 match

@theo•Updated 1 year ago
1export function thanksPiazza() {
2 console.log("good find!");
3}

userValsmain.tsx1 match

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function userVals({ token, id }: {
4 token?: string;
5 id: string;

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.