Introduction to the JNV Project
JNV is a tool developed for users who work with JSON data, providing an interactive environment for viewing JSON structure and editing filters using the jq
language. It is inspired by other projects like jid and jiq, aiming to make JSON navigation both efficient and user-friendly.
Key Features
-
Interactive JSON Viewer: JNV allows users to interactively view JSON data with syntax highlighting, making it easier to read and understand the nested structures.
-
jq
Filter Editor: Users can apply and editjq
filters, a powerful command-line JSON processor, to manipulate their JSON data directly within JNV. The integration withjaq
, ajq
clone, simplifies usage as users do not need to manage complex dependencies. -
Data Input Flexibility: JNV can handle input from files or standard input in various formats, including single and multiple JSON structures, thanks to the support of tools like StreamDeserializer.
-
Auto-Completion and Hints: For ease of use, JNV features auto-completion for common JSON patterns and provides hints to assist in the evaluation of jq filters.
-
Customization Options: JNV supports a range of settings to define how JSON data is displayed, including indentation, depth levels for expanded JSON nodes, and the number of suggestions shown during auto-completion.
Installation Methods
JNV can be installed using various methods, ensuring compatibility across multiple systems:
- Homebrew: Simple installation on macOS via Homebrew.
- MacPorts: Another installation option for macOS users through MacPorts.
- Nix/NixOS: Availability for Nix-based systems.
- conda-forge: Installation via the conda package manager for various platforms.
- Docker: Users can build and run JNV using Docker containers.
- Cargo: Installation using Cargo, the Rust package manager, for those developing in Rust.
Usage Examples
Users can interact with JNV by providing JSON files as input or by piping JSON data through standard input:
cat data.json | jnv
# or
jnv data.json
These commands allow users to navigate and filter JSON data easily from the command line.
Keyboard Shortcuts
JNV offers a range of keyboard shortcuts to streamline user interaction:
- Navigation: Use arrow keys for basic navigation within the JSON viewer.
- Editing: Shortcuts like Ctrl + C to exit, Ctrl + A/E to move to the start/end of a filter, and Tab for auto-completion are available.
- Clipboard Operations: Easily copy JSON contents or current queries using Ctrl + O and Ctrl + Q respectively.
Conclusion
JNV is a robust tool designed for developers and data analysts who frequently work with JSON data. Its interactive interface, combined with powerful filtering capabilities, makes it a valuable addition to any workflow involving JSON processing. Whether you are manipulating large data sets or constructing complex queries, JNV provides the tools needed to efficiently manage JSON data. With its extensive installation options and user-friendly features, JNV caters to a broad range of users, enhancing productivity and simplifying JSON data handling.