Giter Club home page Giter Club logo

jnv's Introduction

jnv

jnv is designed for navigating JSON, offering an interactive JSON viewer and jq filter editor.

demo

Inspired by jid and jiq.

Features

  • Interactive JSON viewer and jq filter editor
    • Syntax highlighting for JSON
  • Accept JSON from stdin, file, URL
  • Auto-completion for the filter
  • Hint message to evaluate the filter

Installation

Homebrew

brew install ynqa/tap/jnv

Cargo

Requirements

cargo install jnv

Note

jnv does not require users to install jq on their system, because it utilizes j9 Rust bindings.

Examples

cat data.json | jnv

Or

jnv data.json

Keymap

Key Action
Ctrl + C Exit jnv
Tab jq filter auto-completion
Move the cursor one character to the left
Move the cursor one character to the right
Ctrl + A Move the cursor to the start of the filter
Ctrl + E Move the cursor to the end of the filter
Backspace Delete a character of filter at the cursor position
Ctrl + U Delete all characters of filter
, Ctrl + K Move the cursor one entry up in JSON viewer
, Ctrl + J Move the cursor one entry down in JSON viewer
Ctrl + H Move to the last entry in JSON viewer
Ctrl + L Move to the first entry in JSON viewer
Enter Toggle expand/collapse in JSON viewer
Ctrl + P Expand all folds in JSON viewer
Ctrl + N Collapse all folds in JSON viewer

Usage

JSON navigator and interactive filter leveraging jq

Usage: jnv [OPTIONS] [INPUT]

Examples:
- Read from a file:
        jnv data.json

- Read from standard input:
        cat data.json | jnv

Arguments:
  [INPUT]
          Optional path to a JSON file. If not provided or if "-" is specified, reads from standard input

Options:
  -e, --edit-mode <EDIT_MODE>
                  Specifies the edit mode for the interface.
                  Acceptable values are "insert" or "overwrite".
                  - "insert" inserts a new input at the cursor's position.
                  - "overwrite" mode replaces existing characters with new input at the cursor's position.
          [default: insert]

  -i, --indent <INDENT>
                  Affect the formatting of the displayed JSON,
                  making it more readable by adjusting the indentation level.
          [default: 2]

  -n, --no-hint
                  When this option is enabled, it prevents the display of
                  hints that typically guide or offer suggestions to the user.

  -d, --expand-depth <EXPAND_DEPTH>
                  Specifies the initial depth to which JSON nodes are expanded in the visualization.
                  Note: Increasing this depth can significantly slow down the display for large datasets.
          [default: 3]

  -l, --suggestion-list-length <SUGGESTION_LIST_LENGTH>
                  Controls the number of suggestions displayed in the list,
                  aiding users in making selections more efficiently.
          [default: 3]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

jnv's People

Contributors

corneliusroemer avatar nshalman avatar ynqa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.