JSONView
display
JSONView: a syntax-colored, collapsible JSON viewer
Terminal
$termuijs render j-s-o-n-view
Installation
$ bunx termuijs add j-s-o-n-view
Copies the source into src/components/j-s-o-n-view/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { JSONView } from '@termuijs/widgets'ts
new JSONView(options: JSONViewOptions, style: Partial<Style> = {})API Reference
JSONView
| Prop | Type | Required | Description |
|---|---|---|---|
data | unknown | required | The JSON value to display |
onSelect | (node: TreeNode, path: number[]) => void | optional | Callback when a leaf node is selected |
indent | number | optional | Spaces per indent level (default: 2) |