A powerful development console for Nuxt 3 applications that provides real-time monitoring, advanced logging, filtering, and debugging capabilities with zero production overhead.
View Demo Β· Report Bug Β· Request Feature
- Interactive console interface with customizable positioning and dimensions
- Real-time log monitoring and filtering
- Advanced search capabilities with search history
- Log persistence with intelligent storage management
- Support for log groups and collapsible entries
- Multiple export formats (JSON, CSV, TXT)
- Automatic log persistence between page reloads
- Intelligent quota management for localStorage
- Configurable maximum log history
- Log grouping and nesting support
- Copy-to-clipboard functionality
- Virtual scrolling for optimal performance
- Three theme modes (dark/light/system) with custom theme support
- Customizable position (top-right, top-left, bottom-right, bottom-left)
- Resizable console window
- Color-coded log levels
- Tag visualization and filtering
- Collapsible log entries
# npm
npm install @opto-code/nuxt-dev-console
# yarn
yarn add @opto-code/nuxt-dev-console
# pnpm
pnpm add @opto-code/nuxt-dev-console- Add the module to your
nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@opto-code/nuxt-dev-console'],
devConsole: {
enabled: true
}
})- Add the console component to your app:
<template>
<div>
<!-- Your app content -->
<DevConsole />
</div>
</template>export default defineNuxtConfig({
modules: ['@opto-code/nuxt-dev-console'],
devConsole: {
// Basic settings
enabled: true,
allowProduction: false,
// Visual Configuration
position: 'bottom-right',
theme: 'dark',
height: 600,
width: 800,
// Functionality
maxLogHistory: 1000,
queueSize: 1000,
flushInterval: 100
}
})See our Configuration Guide for detailed options.
// Automatic console method capture
console.log('Hello World')
console.info('Server started', { port: 3000 })
console.warn('Deprecated feature used')
console.error('Connection failed', new Error('Timeout'))
// Using the global logger
const { $devLogger } = useNuxtApp()
$devLogger.log('Hello from dev logger')// Get console reference
const devConsole = ref(null)
// Log with tags for better organization
devConsole.value?.logWithTags(['user', 'auth'], 'User logged in', { userId: 123 })
devConsole.value?.errorWithTags(['api', 'error'], 'API failed', new Error('Network error'))
devConsole.value?.warnWithTags(['perf'], 'Slow operation', { latency: '500ms' })// Create collapsible groups
console.group('API Requests')
console.log('GET /api/users')
console.log('POST /api/data')
console.groupEnd()
// Collapsed by default
console.groupCollapsed('Performance Metrics')
console.log('Load time: 1.2s')
console.log('First paint: 0.8s')
console.groupEnd()// Export logs programmatically
window.$devLogger.exportLogs() // JSON format
window.$devLogger.exportLogs('csv') // CSV format
window.$devLogger.exportLogs('txt') // Text format| Shortcut | Action |
|---|---|
ctrl+shift+d |
Toggle console visibility |
ctrl+l |
Clear console |
ctrl+f |
Focus search bar |
esc |
Close console |
devConsole: {
theme: 'dark',
customTheme: {
dark: {
background: '#1a1a1a',
text: '#ffffff'
},
light: {
background: '#ffffff',
text: '#000000'
}
}
}- Use consistent tag naming across your application
- Combine broad and specific tags for better filtering
- Include relevant data objects with your logs
- Use log groups for related operations
- Add timestamps for time-sensitive operations
- Configure appropriate
maxLogHistoryfor your needs - Regularly clear old logs to maintain performance
- Use tag filtering to focus on relevant information
- Export logs for long-term storage or analysis
- Position the console where it won't interfere with UI testing
- Use keyboard shortcuts for faster navigation
- Utilize search history for common queries
- Export logs when debugging complex issues
- Configure appropriate log levels for different environments
The module includes full TypeScript definitions for all features:
interface DevLogger {
log(...args: any[]): void
info(...args: any[]): void
warn(...args: any[]): void
error(...args: any[]): void
debug(...args: any[]): void
group(label: string): void
groupEnd(): void
time(label: string): void
timeEnd(label: string): void
// ... more methods
}- Dev Console Documentation - UI component details
- Dev Logger Documentation - Logging utility details
- Contributing Guide - How to contribute
- Changelog - Version history
Contributions are welcome! Please read our Contributing Guide first.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Released under the MIT License.