Share TypeScript code with CodeThis
TypeScript adds static types on top of JavaScript. CodeThis preserves the generics, inference, and decorators in the paste.
Paste TypeScript nowWhat you get
- TypeScript-aware syntax highlighting via CodeMirror
- Instant shareable link — no signup required
- Optional expiration (7 days, 30 days, permanent)
- Password protection for private pastes
- Works with the REST API and MCP server
- Rich markdown and MDC components alongside code
Common use cases for TypeScript pastes
- Type-safe utility functions
- Library API surface examples
- Type-level puzzles and Zod schemas
- Design-doc code samples
Example
type Result<T, E = Error> =
| { ok: true; value: T }
| { ok: false; error: E }
const wrap = async <T>(fn: () => Promise<T>): Promise<Result<T>> => {
try { return { ok: true, value: await fn() } }
catch (e) { return { ok: false, error: e as Error } }
}
Related languages
Ready to share some TypeScript?