Search
doesAdamSux
@ooo_ooo_oooooh
An interactive, runnable TypeScript val by ooo_ooo_oooooh
Script
export function doesAdamSux() {
return "Yes stupid.";
wonderfulAquaEmu
@Akshat1236
An interactive, runnable TypeScript val by Akshat1236
HTTP
export default async function(req: Request): Promise<Response> {
return Response.json({ ok: true });
valle_tmp_418674886600415720477086592392646
@janpaul123
// This val will respond to HTTP requests with a simple "Hello, world!" message.
HTTP
// This val will respond to HTTP requests with a simple "Hello, world!" message.
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, world!");
accessibleScarletToad
@fahmi
An interactive, runnable TypeScript val by fahmi
HTTP
export default async function(req: Request): Promise<Response> {
const url =
"https://script.google.com/macros/s/AKfycbwzkp9Nr29pws2ShKq9ZlI1W-DaLmKBJbGBk8kYuw4bOkmyWvgdE7E6M5d6YwUITekf/exec";
val_GdQyHIp24O
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {

publicDocumentEditor
@tr3ntg
An interactive, runnable TypeScript val by tr3ntg
Script
export async function publicDocumentEditor(
req: express.Request,
res: express.Response,
let html =
`<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Editor.js ๐คฉ๐งฆ๐คจ example</title> <link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet"> <link href="../public/assets/demo.css" rel="stylesheet"> <script src="../public/assets/json-preview.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /></head><body> <div class="ce-example"> <div class="ce-example__header"> <a class="ce-example__header-logo" href="https://codex.so/editor">Editor.js ๐คฉ๐งฆ๐คจ</a> <div class="ce-example__header-menu"> <a href="https://github.com/editor-js" target="_blank">Plugins</a> <a href="https://editorjs.io/usage" target="_blank">Usage</a> <a href="https://editorjs.io/configuration" target="_blank">Configuration</a> <a href="https://editorjs.io/creating-a-block-tool" target="_blank">API</a> </div> </div> <div class="ce-example__content _ce-example__content--small"> <div id="editorjs"></div> <div class="ce-example__button" id="saveButton"> editor.save() </div> <div class="ce-example__statusbar"> Readonly: <b id="readonly-state"> Off </b> <div class="ce-example__statusbar-button" id="toggleReadOnlyButton"> toggle </div> </div> </div> <div class="ce-example__output"> <pre class="ce-example__output-content" id="output"></pre> <div class="ce-example__output-footer"> <a href="https://codex.so" style="font-weight: bold;">Made by CodeX</a> </div> </div> </div> <!-- Load Tools --> <!-- You can upload Tools to your project's directory and connect them by relative links. Also you can load each Tool from CDN or use NPM/Yarn packages. Read more at Tools Connection doc: https://editorjs.io/getting-started#tools-connection --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/header@latest"></script><!-- Header --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/simple-image@latest"></script><!-- Image --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/delimiter@latest"></script><!-- Delimiter --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script><!-- List --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/checklist@latest"></script><!-- Checklist --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/quote@latest"></script><!-- Quote --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/code@latest"></script><!-- Code --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script><!-- Embed --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/table@latest"></script><!-- Table --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/link@latest"></script><!-- Link --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/warning@latest"></script><!-- Warning --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/marker@latest"></script><!-- Marker --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/inline-code@latest"></script><!-- Inline Code --> <!-- Load Editor.js's Core --> <script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script><script>var editor=new EditorJS({readOnly:!1,holder:'editorjs',tools:{header:{class:Header,inlineToolbar:['marker','link'],config:{placeholder:'Header'},shortcut:'CMD+SHIFT+H'},image:SimpleImage,list:{class:List,inlineToolbar:!0,shortcut:'CMD+SHIFT+L'},checklist:{class:Checklist,inlineToolbar:!0,},quote:{class:Quote,inlineToolbar:!0,config:{quotePlaceholder:'Enter a quote',captionPlaceholder:'Quote\'s author',},shortcut:'CMD+SHIFT+O'},warning:Warning,marker:{class:Marker,shortcut:'CMD+SHIFT+M'},code:{class:CodeTool,shortcut:'CMD+SHIFT+C'},delimiter:Delimiter,inlineCode:{class:InlineCode,shortcut:'CMD+SHIFT+C'},linkTool:LinkTool,embed:Embed,table:{class:Table,inlineToolbar:!0,shortcut:'CMD+ALT+T'},},data:{},onReady:function(){saveButton.click()},onChange:function(api,event){console.log('something changed',event)}});const saveButton=document.getElementById('saveButton');const toggleReadOnlyButton=document.getElementById('toggleReadOnlyButton');const readOnlyIndicator=document.getElementById('readonly-state');saveButton.addEventListener('click',function(){editor.save().then((savedData)=>{cPreview.show(savedData,document.getElementById("output"))}).catch((error)=>{console.error('Saving error',error)})});toggleReadOnlyButton.addEventListener('click',async()=>{const readOnlyState=await editor.readOnly.toggle();readOnlyIndicator.textContent=readOnlyState?'On':'Off'})</script></body></html>`;
res.send(html);
beamingEmeraldSloth
@Itumeleng_Randy_Malau
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
rate: "$150/session"
function CommuniZEN() {
const [activeSection, setActiveSection] = useState('dashboard');
cursor: 'pointer'
function client() {
createRoot(document.getElementById("root")).render(<CommuniZEN />);
client();
export default async function server(request: Request): Promise<Response> {
return new Response(`
valle_tmp_50449610377968496666839612547843
@janpaul123
// This val serves an HTML page emulating a Hacker News clone.
HTTP
// This val serves an HTML page emulating a Hacker News clone.
// Titles are clickable and lead to a page with fake story content.
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
const pathname = url.pathname;
fetchWebpage
@jdan
An interactive, runnable TypeScript val by jdan
Script
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
export async function fetchWebpage(args: { url: string }) {
const { url } = args;
const html = await fetchText(args.url);
AboutNoelandLiam
@richi1969
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function FAQ({ question, answer }) {
const [isOpen, setIsOpen] = useState(false);
</div>
function GallagherArticle() {
const faqs = [
</div>
function client() {
createRoot(document.getElementById("root")).render(<GallagherArticle />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
frame
@nlnw
Minimal val.town Farcaster Frame example. It supports dynamic image generation with Satori and ReSVG, and it's compatible with the Open Frames standard.
HTTP
import satori from "npm:satori";
const app = new Hono();
async function renderImage(s: string, color: string) {
const fontArrayBuf = await fetch(
"https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-regular-webfont.ttf",

satisfiedPinkAnteater
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({ ok: true })

webscrapeWikipediaIntro
@vtdocs
An interactive, runnable TypeScript val by vtdocs
HTTP
const cheerio = await import("npm:cheerio");
const html = await fetchText(
"https://en.wikipedia.org/wiki/OpenAI",
const $ = cheerio.load(html);
// Cheerio accepts a CSS selector, here we pick the second <p>