ts-quick-ref
v0.1.3
Published
Interactive CLI for JavaScript (MDN) and TypeScript documentation reference
Downloads
454
Maintainers
Readme
ts-quick-ref
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.
Installation
npm install -g ts-quick-refOr run directly with npx:
npx ts-quick-ref Array.mapUsage
Quick Lookup
# JavaScript (MDN) documentation
ts-quick-ref Array.map
ts-quick-ref Promise.all
ts-quick-ref Object.keys
ts-quick-ref fetch
# TypeScript documentation
ts-quick-ref generics
ts-quick-ref interfaces
ts-quick-ref utility
ts-quick-ref narrowingSpecify Source
# Force JavaScript/MDN source
ts-quick-ref --source js Array
# Force TypeScript source
ts-quick-ref --source ts generics
ts-quick-ref -s typescript mappedSearch
# 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"Interactive Mode
Launch the interactive TUI for browsing documentation:
ts-quick-ref
ts-quick-ref -i
ts-quick-ref --interactiveKeyboard shortcuts:
Enter- Search / Select↑↓- Navigate resultsEsc- Go backq- Quit
Cache Management
# View cache statistics
ts-quick-ref cache stats
# Pre-fetch common documentation for offline use
ts-quick-ref cache update
# Clear the cache
ts-quick-ref cache clearCommands
| Command | Description |
|---------|-------------|
| ts-quick-ref <query> | Look up documentation for a topic |
| ts-quick-ref search <query> | Search documentation |
| ts-quick-ref cache <action> | Manage documentation cache |
Options
| Option | Description |
|--------|-------------|
| -s, --source <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
JavaScript (MDN)
- 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)
TypeScript
- 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,tuples
How It Works
- Hybrid Caching: Documentation is fetched from MDN and TypeScript sources, then cached locally in SQLite for fast offline access
- Smart Lookup: Searches use fuzzy matching to find the best results
- 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.
Requirements
- Node.js >= 18.0.0
Attribution
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.
License
MIT
