npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sqlite-explorer-cli

v1.0.2

Published

Professional SQLite database explorer with CLI and web UI

Readme

🗄️ SQLite Explorer Pro - CLI Edition

A professional SQLite database explorer with a beautiful dark-themed web UI, built with Node.js, Express, and Tailwind CSS.

✨ Features

🎯 Core Functionality

  • Interactive SQL Editor: Write and execute SQL queries with syntax highlighting
  • Table Browser: View all tables with expandable schemas
  • Schema Viewer: Detailed column information with types and constraints
  • Query History: Track and reuse your last 10 queries
  • CSV Export: Export query results to CSV files
  • Real-time Execution: See execution time and row counts
  • Error Handling: Detailed error messages for failed queries

🎨 Beautiful UI

  • Modern dark theme using Tailwind CSS
  • Responsive three-pane layout with resizable panels
  • Smooth animations and transitions
  • Toast notifications for user feedback
  • Professional color scheme and typography
  • Status indicators with real-time updates

🚀 CLI Features

  • Commander.js integration for command-line arguments
  • Colored terminal output with Chalk
  • Auto-open browser option
  • Graceful shutdown handling
  • Optional database file parameter

Screenshots

SqlEx

Web Version

SQLite Explorer Pro

📦 Installation

npm install -g sqlite-explorer-cli

🔧 Usage

Open a Specific Database

sqlex path/to/database.db -p 7890

🎮 Keyboard Shortcuts

  • Ctrl/Cmd + Enter: Run query
  • Escape: Close notifications

🖥️ User Interface

Left Panel - Table Browser

  • Lists all tables in the database
  • Shows row count for each table
  • Expandable schema view with:
    • Column names
    • Data types
    • Primary key indicators
    • Constraints
  • Click any table to load a SELECT query

Middle Panel - SQL Editor

  • Syntax highlighting
  • Multi-line query support
  • Auto-formatting option
  • Clear button
  • Keyboard shortcuts

Right Panel - Results Viewer

  • Tabular display of query results
  • Scrollable for large datasets
  • NULL value highlighting
  • Row count display
  • CSV export button

Bottom Panel - Query History

  • Last 10 queries saved
  • Click to restore any query
  • Clear history option
  • Timestamps for each query

🔌 API Endpoints

The server exposes the following REST API endpoints:

GET /api/info

Get database connection status and metadata

{
  "connected": true,
  "path": "/path/to/database.db",
  "name": "database.db",
  "tableCount": 5,
  "tables": ["users", "products", ...]
}

GET /api/tables

Get all tables with schema information

[
  {
    "name": "users",
    "rowCount": 150,
    "columns": [
      {
        "cid": 0,
        "name": "id",
        "type": "INTEGER",
        "notnull": 1,
        "pk": 1
      },
      ...
    ]
  },
  ...
]

GET /api/tables/:name/schema

Get detailed schema for a specific table

{
  "columns": [...],
  "indexes": [...],
  "foreignKeys": [...]
}

POST /api/query

Execute a SQL query

{
  "sql": "SELECT * FROM users LIMIT 10"
}

Response:

{
  "success": true,
  "result": {
    "type": "select",
    "columns": ["id", "name", "email"],
    "rows": [...],
    "rowCount": 10
  },
  "executionTime": 15.2
}

GET /api/tables/:name/export

Export table as CSV file

🛠️ Technology Stack

  • Backend: Node.js + Express.js
  • Database: better-sqlite3 (synchronous SQLite)
  • CLI: Commander.js
  • Terminal: Chalk (colored output)
  • Frontend: Vanilla JavaScript + Tailwind CSS
  • Browser: Auto-open with 'open' package

🎯 Use Cases

Development

  • Quick database inspection during development
  • Test SQL queries before implementing in code
  • Debug database schema issues
  • Explore unfamiliar databases

Data Analysis

  • Run ad-hoc queries on SQLite databases
  • Export filtered data to CSV
  • Analyze table relationships
  • Check data integrity

Database Management

  • View table structures
  • Check row counts
  • Inspect indexes and foreign keys
  • Execute maintenance queries

🔒 Security Notes

  • Read-Only Mode: For production databases, consider implementing read-only mode
  • Access Control: No authentication by default - add if exposing to network
  • SQL Injection: User input is passed directly to SQLite - use with trusted users
  • Local Only: Server binds to localhost by default

💡 Tips & Tricks

  1. Table Navigation: Click on any table in the left panel to auto-generate a SELECT query

  2. Query Formatting: Use the Format button to clean up messy SQL

  3. History: Click any query in the history panel to restore it to the editor

  4. Export: Run a SELECT query, then click "Export CSV" to download results

  5. Multiple Statements: The editor supports multiple statements, but only the last result is shown

  6. NULL Values: NULL values are displayed in italics and gray for easy identification

  7. Keyboard Shortcuts: Use Ctrl/Cmd+Enter to quickly run queries

🐛 Troubleshooting

Database won't load

  • Check file path is correct
  • Ensure file has read permissions
  • Verify it's a valid SQLite database

Port already in use

sqlex database.db -p 3001

Browser doesn't open

  • Try manually visiting http://localhost:3000
  • Or use --no-open flag and copy the URL

Query fails

  • Check SQL syntax
  • Verify table/column names
  • Look at error message in notification

🚀 Future Enhancements

Potential features for future versions:

  • [ ] Monaco Editor integration for better syntax highlighting
  • [ ] Query auto-completion
  • [ ] Save/load query files
  • [ ] Database diff viewer
  • [ ] ER diagram generator
  • [ ] Multi-tab query support
  • [ ] Query performance analysis
  • [ ] Transaction support
  • [ ] Dark/light theme toggle

📄 License

MIT (c) Mohan Chinnappan