TypeScript

Share TypeScript code online.

Share TypeScript snippets, type definitions, or utility functions: syntax-highlighted, encrypted, and shareable without an account.

textdrop.sh/xk4mR2
1type Result<T, E = Error> =2  | { ok: true;  value: T }3  | { ok: false; error: E };45async function fetchJson<T>(url: string): Promise<Result<T>> {6  try {7    const res = await fetch(url);8    if (!res.ok) throw new Error(`HTTP ${res.status}: ${res.statusText}`);9    const value = (await res.json()) as T;10    return { ok: true, value };11  } catch (error) {12    return { ok: false, error: error as Error };13  }14}1516// Usage17const result = await fetchJson<{ users: User[] }>("/api/users");18if (result.ok) {19  console.log(result.value.users);20}
Every paste includes

TypeScript syntax highlighting

Paste TypeScript code and get a shareable link with full syntax highlighting, server-side rendered with no JavaScript overhead.

Burn after read

Deleted on first open. Can't be viewed twice.

Password protection

Add a password for end-to-end encryption with no raw key stored.

Configurable expiry

Set pastes to expire after 1 hour, 1 day, 7 days, or up to 30 days. Gone when you say so.

No account needed

No sign-up, no email, no ads. Paste and share in seconds.

How it works
Plain Text
Markdown
Code
DB_HOST=db-01.prod.internal
DB_USER=api_svc
DB_PASS=xK9$mP2!qR7nLw2
REDIS_URL=redis://:abc@cache:6379
delete after setup — expires 1hr
7 days
Share
textdrop.sh/
7 days · plain text
Use cases
  • 01Share utility types and helper functions
  • 02Send API response type definitions for review
  • 03Share complex generic type patterns
  • 04Distribute SDK integration snippets
  • 05Share Next.js server action examples
FAQ
Can I share .tsx files with JSX syntax?+

Yes. Select TypeScript as the language: Shiki's TypeScript grammar includes full JSX/TSX support, so React component code highlights correctly.

Is there a size limit for TypeScript pastes?+

Pastes are capped at 5 MB, plenty for any single file or snippet.

Can I share a paste that expires automatically?+

Yes. Set an expiry from 1 hour to 30 days when creating a paste. After expiry the paste is permanently deleted from the server.

Other languages
Drop your code