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=1747&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 18321 results for "function"(1745ms)

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;

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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.