Search

Results include substring matches and semantically similar vals. Learn more
eval avatar
eval
@eval
An interactive, runnable TypeScript val by eval
Script
export function eval(num) {
if (num < 0) return -1;
else if (num == 0) return 1;
dhvanil avatar
val_bst0kyscFe
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_bst0kyscFe(req) {
try {
// Execute the code directly and capture its result
wfortin avatar
myApi
@wfortin
An interactive, runnable TypeScript val by wfortin
Script
export function myApi(name) {
const lastUsedName = name;
return "hi " + name;
yun avatar
myApi
@yun
An interactive, runnable TypeScript val by yun
Script
export function myApi(name) {
return "hi " + name;
azkasources avatar
respectfulMagentaQuelea
@azkasources
@jsxImportSource https://esm.sh/react
HTTP
keyPoints: string[];
function ResearchTool() {
const [query, setQuery] = useState('');
</div>
function client() {
createRoot(document.getElementById('root')).render(<ResearchTool />);
if (typeof document !== 'undefined') { client(); }
export default async function server(request: Request): Promise<Response> {
// Server-side research handler
liamdanielduffy avatar
helloWorld
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
export function helloWorld() {
return "hello world";
brandon avatar
hnFollowPollJob
@brandon
An interactive, runnable TypeScript val by brandon
Cron
import { hackerNewsAuthors } from "https://esm.town/v/brandon/hackerNewsAuthors";
import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
export async function hnFollowPollJob({ lastRunAt }) {
let posts = await hnLatestPosts({
authors: hackerNewsAuthors,
torlanco avatar
shirtGenScript
@torlanco
👕 Shirtgen API Endpoint Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! 🖋️ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! 🚀 💡 How it Works Send a POST request to the endpoint with your design prompt. Toggle between Standard and Pro models using the useProModel flag. The AI generates a high-quality t-shirt design based on your prompt. 📥 Expected POST Data { "prompt": "A retro sunset with palm trees 🌴🌅", "useProModel": true }
HTTP
export default async function server(request: Request): Promise<Response> {
if (request.method !== "POST") {
return new Response("Method Not Allowed", { status: 405 });
swyx avatar
myApi
@swyx
An interactive, runnable TypeScript val by swyx
Script
export function myApi(name) {
return "hi " + name;
tacascer avatar
myApi
@tacascer
An interactive, runnable TypeScript val by tacascer
Script
export function myApi(name) {
return "hi " + name;
just_be avatar
content_addressable_js
@just_be
Content Addressable JavaScript This is a project I'm working on at the Recurse Center for Impossible Day. The aim is to build a module system that's a little bit similar to how Unison works. Follow along on my site .
Script
import { parse, type Program } from "npm:acorn";
* Can't do content addressability without a good hash function
* String -> SHA256 hash
break;
* Our meat and potatoes. This is the function that will gradually transform the AST into something uniform.
const normalize = (node: Record<string, unknown>) => {
// comments should be ignored
function helloWorld() {}
const goodByeCruelWorld = () => {}
const goodByeCruelWorld = () => {}
function helloWorld() {}
assertEquals(chunk1.contentMap, chunk2.contentMap);
jollytoad avatar
helloWorld
@jollytoad
Hello world server, using http functions . Try hitting URLs such as: /world , /world.txt , /world.json , /world.html , or even /<script>.html . This demonstrates how you can import and compose simple functions to construct a router to route based on various aspects of a request, ie. the URL path, method, and even on media-types based on path extension or the Accept header. See routing functions , and response helpers on JSR. For a more detailed guide on building a Deno app, including things like fs based routing, with these fns see... https://jollytoad.deno.dev/blog/http_getting_started
HTTP
Hello world server, using [http functions](https://jsr.io/@http).
Try hitting URLs such as: [/world](https://jollytoad-helloworld.web.val.run/world), [/world.txt](https://jollytoad-helloworld
This demonstrates how you can import and compose simple functions to construct a router to route based on various aspects of
See [routing functions](https://jsr.io/@http/route), and [response helpers](https://jsr.io/@http/response) on JSR.
For a more detailed guide on building a Deno app, including things like fs based routing, with these fns see... https://jolly
mantas_ avatar
myApi
@mantas_
An interactive, runnable TypeScript val by mantas_
Script
export function myApi(name) {
return "hi " + name;
muhammad_owais_warsi avatar
virtualPetSim
@muhammad_owais_warsi
// This app will create a virtual pet simulation game where users can adopt, care for, and interact with a digital creature.
HTTP
const FOODS = ["🍎", "🍌", "🥕", "🍖", "🍣"];
function App() {
const [pet, setPet] = useState(null);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
"content-type": "text/html",
async function getPet() {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
return pet;
async function updatePet(action) {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
fallenmax avatar
greeting
@fallenmax
// View at https://fallenmax-greeting.express.val.run?name=myName
Express (deprecated)
// View at https://fallenmax-greeting.express.val.run?name=myName
export async function greeting(req: express.Request, res: express.Response) {
const name = String(req.query.name);
const text = `Hello ${name}`;