Interactive CLI for JavaScript (MDN) and TypeScript documentation reference
Interactive CLI for JavaScript (MDN) and TypeScript documentation reference.
Quickly look up JavaScript APIs and TypeScript concepts directly from your terminal with offline caching and a beautiful interactive interface.
``bash`
npm install -g ts-quick-ref
Or run directly with npx:
`bash`
npx ts-quick-ref Array.map
`bashJavaScript (MDN) documentation
ts-quick-ref Array.map
ts-quick-ref Promise.all
ts-quick-ref Object.keys
ts-quick-ref fetch
$3
`bash
Force JavaScript/MDN source
ts-quick-ref --source js ArrayForce TypeScript source
ts-quick-ref --source ts generics
ts-quick-ref -s typescript mapped
`$3
`bash
Search across all documentation
ts-quick-ref search "array methods"
ts-quick-ref s "promise"Search specific source
ts-quick-ref search --source mdn "fetch api"
ts-quick-ref search --source ts "type guards"Limit results
ts-quick-ref search --limit 5 "string"Offline search (cached docs only)
ts-quick-ref search --offline "array"
`$3
Launch the interactive TUI for browsing documentation:
`bash
ts-quick-ref
ts-quick-ref -i
ts-quick-ref --interactive
`Keyboard shortcuts:
-
Enter - Search / Select
- ↑↓ - Navigate results
- Esc - Go back
- q - Quit$3
`bash
View cache statistics
ts-quick-ref cache statsPre-fetch common documentation for offline use
ts-quick-ref cache updateClear the cache
ts-quick-ref cache clear
`Commands
| Command | Description |
|---------|-------------|
|
ts-quick-ref | Look up documentation for a topic |
| ts-quick-ref search | Search documentation |
| ts-quick-ref cache | Manage documentation cache |Options
| Option | Description |
|--------|-------------|
|
-s, --source | Source to search: mdn, js, ts, typescript |
| -r, --raw | Output raw markdown without terminal formatting |
| -i, --interactive | Start interactive TUI mode |
| -V, --version | Show version number |
| -h, --help | Show help |Supported Topics
$3
- Global objects:
Array, Object, String, Number, Promise, Map, Set, Date, RegExp, JSON, Math, Error
- Array methods: Array.map, Array.filter, Array.reduce, Array.find, Array.forEach
- Object methods: Object.keys, Object.values, Object.entries, Object.assign
- Promise methods: Promise.all, Promise.race, Promise.allSettled
- Statements: for, if, const, let, async, await, class, import, export
- Operators: ... (spread), ?. (optional chaining), ?? (nullish coalescing)$3
- Basics:
types, basics, everyday-types
- Type System: generics, interfaces, type, union, intersection
- Narrowing: narrowing, type-guards, never
- Advanced Types: keyof, typeof, conditional, mapped, template
- Other: classes, modules, functions, objects, tuplesHow It Works
1. Hybrid Caching: Documentation is fetched from MDN and TypeScript sources, then cached locally in SQLite for fast offline access
2. Smart Lookup: Searches use fuzzy matching to find the best results
3. Terminal Rendering: Markdown is rendered with syntax highlighting for readability
Cache Location
Documentation is cached at:
- Linux/macOS:
~/.ts-quick-ref/cache.db
- Windows: %USERPROFILE%\.ts-quick-ref\cache.db`Cache expires after 7 days and is automatically refreshed on next lookup.
- Node.js >= 18.0.0
This tool fetches and caches documentation from the following sources:
- JavaScript documentation: MDN Web Docs, licensed under CC-BY-SA 2.5
- TypeScript documentation: TypeScript Handbook, © Microsoft, licensed under Apache 2.0
This project is not affiliated with Mozilla or Microsoft.
MIT