@mouji/json-viewer
v1.0.1
Published
Open JSON files visually in your browser
Readme
@mouji/json-viewer
A CLI tool to view JSON files visually in your browser.
Features
- Visual JSON editor with tree and form views
- Open a single JSON file or an entire directory
- Search functionality
- Read-only mode
- Customizable port
- Dark theme with neutral gray palette
Quick Start
pnpm dlx @mouji/json-viewer ./data.jsonUsage
# Open a single JSON file
pnpm dlx @mouji/json-viewer ./data.json
# Open all JSON files in a directory
pnpm dlx @mouji/json-viewer ./path/to/directory
# Specify a different port
pnpm dlx @mouji/json-viewer ./data.json --port 8080
# Open in read-only mode
pnpm dlx @mouji/json-viewer ./data.json --readonly
# Start server without opening browser
pnpm dlx @mouji/json-viewer ./data.json --no-openTips
Add an alias to your shell config (e.g., ~/.zshrc) for quicker access:
alias vjv='pnpm dlx @mouji/json-viewer'Then use it as:
vjv ./data.jsonOptions
| Option | Description | Default |
|--------|-------------|---------|
| -p, --port <number> | Port for the HTTP server | 3000 |
| -r, --readonly | Open in read-only mode | false |
| --no-open | Start server without opening browser | false |
Local Development
pnpm install
pnpm dev ./data.jsonPress q or Ctrl+C to stop the server.
API
When the server is running, the JSON data is available at:
GET /api/jsonResponse:
{
"files": [
{ "path": "/absolute/path/to/file.json", "name": "file.json", "data": {...} }
],
"readOnly": false
}Acknowledgments
Powered by visual-json by Vercel Labs.
