Documentation Index
Fetch the complete documentation index at: https://mintlify.com/live-codes/livecodes/llms.txt
Use this file to discover all available pages before exploring further.
Overview
LiveCodes provides seamless NPM package imports with:- Automatic module resolution from multiple CDNs
- ES Module support for modern JavaScript
- TypeScript definitions loaded automatically
- No build step required - imports work instantly
Import Syntax
Basic Imports
Import any NPM package using standard ES Module syntax:Version Pinning
Specify exact versions:Subpath Imports
Import from package subpaths:CDN Prefixes
Explicitly specify which CDN to use:- esm.sh (Default)
- Skypack
- jsDelivr
- UNPKG
Supported CDNs
ES Module CDNs
esm.sh
Fast, global CDN with smart module resolution
Skypack
Optimized, cached ES modules
jsDelivr ESM
High-performance, reliable CDN
JSPM
Import maps and module CDN
NPM CDNs (for Assets)
Available NPM CDNs: jsDelivr, UNPKG, npmcdn, and their mirrors.
GitHub CDNs
Load files directly from GitHub:Advanced Features
Import Maps
Define custom import mappings:External Dependencies
Mark dependencies as external to reduce bundle size:Use
#nobundle to prevent bundling and use the CDN version directly.JSR Packages
Import from JavaScript Registry:Package.pr.new
Test package previews:TypeScript Support
Automatic Type Loading
LiveCodes automatically loads TypeScript definitions:Type-Only Imports
Package Hover Info
Hover over any import to see:- Package name and version
- Description
- Links to: npm, GitHub, Skypack, jsDelivr, Bundlephobia
Configuration
Default CDN
Set the default CDN in app settings or project config:Custom CDN
Use a custom CDN URL:Best Practices
Common Patterns
React Application
Using Utility Libraries
CSS Imports
Troubleshooting
Module not found
Module not found
- Check package name spelling
- Verify package exists on npm
- Try different CDN:
skypack:packageorjsdelivr:package - Check browser console for specific error
Type definitions not loading
Type definitions not loading
- Types load automatically for popular packages
- Some packages don’t have types
- Install
@types/packageif available:
CommonJS modules failing
CommonJS modules failing
Use esm.sh which converts CommonJS to ESM:
Slow loading times
Slow loading times
- Use version pinning for better caching
- Try different CDN
- Consider bundling dependencies
CDN Comparison
| CDN | Best For | Speed | Features |
|---|---|---|---|
| esm.sh | Complex deps, CommonJS | Fast | Auto-conversion, types |
| Skypack | Modern ESM | Very Fast | Optimized, cached |
| jsDelivr | Reliability | Fast | Global, stable |
| UNPKG | Simplicity | Medium | Basic, straightforward |
Related Features
- Editor - IntelliSense for imports
- Languages - Language support
- External Resources - Scripts and stylesheets