GUI for editing, visualizing, and manipulating JSON data

Overview

JSON-Splora

JSON-Splora is a GUI for editing, visualizing, and manipulating JSON data with jq or JavaScript.

Demo

Design

The editor is a JavaScript editor, and the input is parsed as json5. This allows for comments as well as a relaxed JSON input format. Once the editor has valid JSON, an input window will appear below, allowing you to manipulate the object with JavaScript or jq. A panel will appear to the right with the output, and updates live as the input or filter changes.

Input

  • URLs resolve to any JSON they return
  • Drag-and-drop or open any file
  • Plain text input

Filters

  • First evaluated as JavaScript with output = x${filter}
  • If JS fails, it attempts to use jq

Command Line

jsplora [file]

Install

Requires at least Node version 6.

Globally (cli)

This will create the application as well as the alias jsplora.

npm i -g json-splora

Locally

Building locally creates a directory JSON-Splora-<system> which contains the application.

npm install

# build for darwin, linux, win32
npm run-script build-darwin
npm run-script build-linux
npm run-script build-win32

Name Change

JSON-Splora is becoming json-splora in npm. This is because of a bug in npm's backend confusing the two packages. I am forced to release 1.0.0, deprecate "JSON-Splora", and move to "json-splora". I apologize for any inconvenience.

Contributing

Contributions are welcome! Please read through and follow the style of the rest of the code. eslint is used as a code pre-commit hook, and will catch many simple errors. Please squash your commits and leave concise commit messages.

License

MIT

Comments
  • Url resolution & menu bugs

    Url resolution & menu bugs

    Added url resolution on paste (based on #10).

    Fill free to change anything (names, filenames...), just wanted to add the basic functionality open to possible refactoring.

    opened by MaanooAk 8
  • Improve installation process

    Improve installation process

    Hello @wellsjo

    I think that isn't the most comfortable way of installing an application the current workflow and we can improve it.

    Using something like: electron-packager Allow more users to install the App.

    What do you think?

    enhancement help wanted 
    opened by davesnx 7
  • Tabs Functionality

    Tabs Functionality

    Heyo! I just wanted to get this up here to get some review as there is a paradigm shift in how tabs are created. Would love to get some feedback and am open to any suggestions!

    Features

    • Multiple tab instances
    • Cmd+T to open new tab
    • Cmd+O opens file in new tab

    Considerations

    • Moved from Page to Tabs/Tab relationship
    • App does not control creation of tabs

    Todo

    • Rewrite tests to incorporate new functionality
    • Tabs class needs to store activeTab when maneuvering between tabs
    opened by kylealwyn 6
  • Add Testing Framework

    Add Testing Framework

    I have added Jasmine and Spectron to the project. Jasmine tests will be automatically ran as a pre-git commit hook. I am contemplating setting up a gulp watch() for continuous test and lint integration (although most ide will lint automatically already).

    Edit: Another consideration, I left /spec/**_spec.js as the glob to find tests. However, it might be easier/more maintainable/ect. to put _spec.js files in a directory closer to the files being tested. For example, putting them in the same directory, or a sub directory. Any preferences/thoughts?

    #51

    opened by vpillinger 6
  • Comments removed on paste

    Comments removed on paste

    On paste the formatInput() which recreates the Json from the parsed data, so the comments are lost because there are ignored from the parser.

    Possible solution: just remove the formatInput() on the paste untill a proper format is implemented.

    bug 
    opened by MaanooAk 6
  • Theme cleanup, Fixed Linting, Added Bracket Highlighting

    Theme cleanup, Fixed Linting, Added Bracket Highlighting

    Cleaned up the code surrounding theme changes. Created a MainMenu class for the purpose of consolidating Menu related code. Also made the menu interface look a little more professional.

    Note: Code Mirror allows multiple themes at once, and I thought about implementing this in the menu, but decided against implementing it for now.

    Issues resolved: https://github.com/wellsjo/JSON-Splora/issues/1

    opened by vpillinger 5
  • Windows node-jq and jq fix

    Windows node-jq and jq fix

    • node-jq v.0.5.0 now supports windows
    • jq has a limit to the length of the arguments, I changed the path of the tmp file from absolute to relative (= smaller) and it works.

    This pr resolves all jq issues in Windows (#56 and others?)

    opened by MaanooAk 4
  • Tests don't run on first install

    Tests don't run on first install

    Steps:

    1. Clone project
    2. npm install
    3. npm test

    Output:

    running validate...passed!
    running test...failed!
    /Users/kyle/Projects/splora/app/js/Editor.js:11
    const { EventEmitter } = require('events')
          ^
    
    SyntaxError: Unexpected token {
        at exports.runInThisContext (vm.js:53:16)
        at Module._compile (module.js:374:25)
        at Object.Module._extensions..js (module.js:405:10)
        at Object.require.extensions.(anonymous function) (/Users/kyle/Projects/splora/node_modules/proxyquire/lib/proxyquire.js:259:43)
        at Module.load (module.js:344:32)
        at Function.Module._load (module.js:301:12)
        at Proxyquire._require (/Users/kyle/Projects/splora/node_modules/proxyquire/lib/proxyquire.js:166:19)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (/Users/kyle/Projects/splora/app/js/Page.js:12:16)
        at Module._compile (module.js:398:26)
    
    opened by kylealwyn 2
  • Add arguments to command line utility

    Add arguments to command line utility

    Right now we can open from the command line with jsplora. We should also allow for arguments. For example: jsplora <file> jsplora --input "<json object>" jsplora --input "<json object>" --filter "<filter-string>"

    opened by wellsjo 2
  • js evaluate result check bug

    js evaluate result check bug

    In Editor.js, line 166 has a bug. if result is empty string or 0, it will run through jq. if (context.result) { ..... } should be if (context.result != undefined) { ..... }

    test code: if(""){alert(1)} //nothing happen if(0){alert(1)} //nothing happen if("1"){alert(1)} // will alert

    bug 
    opened by qifuren1985 2
  • Error on install OSX 10.12.1

    Error on install OSX 10.12.1

    screen shot 2016-12-08 at 10 07 59 am

    I was unable to install through npm. I noticed there was a similar issue here: https://github.com/wellsjo/JSON-Splora/issues/60

    However, my error seems to be different. Here's my npm-debug.log

    $ cat /Users/robmoore/npm-debug.log 
    0 info it worked if it ends with ok
    1 verbose cli [ '/Users/robmoore/.nvm/versions/node/v6.9.2/bin/node',
    1 verbose cli   '/Users/robmoore/.nvm/versions/node/v6.9.2/bin/npm',
    1 verbose cli   'install',
    1 verbose cli   '-g',
    1 verbose cli   'json-splora' ]
    2 info using [email protected]
    3 info using [email protected]
    4 silly loadCurrentTree Starting
    5 silly install loadCurrentTree
    6 silly install readGlobalPackageData
    7 silly fetchPackageMetaData json-splora
    8 silly fetchNamedPackageData json-splora
    9 silly mapToRegistry name json-splora
    10 silly mapToRegistry using default registry
    11 silly mapToRegistry registry https://registry.npmjs.org/
    12 silly mapToRegistry data Result {
    12 silly mapToRegistry   raw: 'json-splora',
    12 silly mapToRegistry   scope: null,
    12 silly mapToRegistry   escapedName: 'json-splora',
    12 silly mapToRegistry   name: 'json-splora',
    12 silly mapToRegistry   rawSpec: '',
    12 silly mapToRegistry   spec: 'latest',
    12 silly mapToRegistry   type: 'tag' }
    13 silly mapToRegistry uri https://registry.npmjs.org/json-splora
    14 verbose request uri https://registry.npmjs.org/json-splora
    15 verbose request no auth needed
    16 info attempt registry request try #1 at 10:07:58 AM
    17 verbose request id b9405668eb5d2016
    18 verbose etag W/"583dd291-1bf"
    19 verbose lastModified Tue, 29 Nov 2016 19:10:09 GMT
    20 http request GET https://registry.npmjs.org/json-splora
    21 http 304 https://registry.npmjs.org/json-splora
    22 verbose headers { date: 'Thu, 08 Dec 2016 17:07:58 GMT',
    22 verbose headers   via: '1.1 varnish',
    22 verbose headers   'cache-control': 'max-age=300',
    22 verbose headers   etag: 'W/"583dd291-1bf"',
    22 verbose headers   age: '277',
    22 verbose headers   connection: 'keep-alive',
    22 verbose headers   'x-served-by': 'cache-sea1923-SEA',
    22 verbose headers   'x-cache': 'HIT',
    22 verbose headers   'x-cache-hits': '1',
    22 verbose headers   'x-timer': 'S1481216878.259426,VS0,VE0',
    22 verbose headers   vary: 'Accept-Encoding' }
    23 silly get cb [ 304,
    23 silly get   { date: 'Thu, 08 Dec 2016 17:07:58 GMT',
    23 silly get     via: '1.1 varnish',
    23 silly get     'cache-control': 'max-age=300',
    23 silly get     etag: 'W/"583dd291-1bf"',
    23 silly get     age: '277',
    23 silly get     connection: 'keep-alive',
    23 silly get     'x-served-by': 'cache-sea1923-SEA',
    23 silly get     'x-cache': 'HIT',
    23 silly get     'x-cache-hits': '1',
    23 silly get     'x-timer': 'S1481216878.259426,VS0,VE0',
    23 silly get     vary: 'Accept-Encoding' } ]
    24 verbose etag https://registry.npmjs.org/json-splora from cache
    25 verbose get saving json-splora to /Users/robmoore/.npm/registry.npmjs.org/json-splora/.cache.json
    26 verbose correctMkdir /Users/robmoore/.npm correctMkdir not in flight; initializing
    27 verbose stack TypeError: Cannot convert undefined or null to object
    27 verbose stack     at pickVersionFromRegistryDocument (/Users/robmoore/.nvm/versions/node/v6.9.2/lib/node_modules/npm/lib/fetch-package-metadata.js:125:29)
    27 verbose stack     at /Users/robmoore/.nvm/versions/node/v6.9.2/lib/node_modules/npm/node_modules/iferr/index.js:13:50
    27 verbose stack     at /Users/robmoore/.nvm/versions/node/v6.9.2/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8
    27 verbose stack     at saved (/Users/robmoore/.nvm/versions/node/v6.9.2/lib/node_modules/npm/lib/cache/caching-client.js:174:7)
    27 verbose stack     at /Users/robmoore/.nvm/versions/node/v6.9.2/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:241:18
    27 verbose stack     at FSReqWrap.oncomplete (fs.js:123:15)
    28 verbose cwd /Users/robmoore
    29 error Darwin 16.1.0
    30 error argv "/Users/robmoore/.nvm/versions/node/v6.9.2/bin/node" "/Users/robmoore/.nvm/versions/node/v6.9.2/bin/npm" "install" "-g" "json-splora"
    31 error node v6.9.2
    32 error npm  v3.10.9
    33 error Cannot convert undefined or null to object
    34 error If you need help, you may report this error at:
    34 error     <https://github.com/npm/npm/issues>
    35 verbose exit [ 1, true ]
    

    Could this be a versioning issue with my version of node(6.9.2) or npm(3.10.9)? Or possibly my use of nvm?

    opened by rob-moore 1
  • Tried to update this to build again, failed.

    Tried to update this to build again, failed.

    First issue:

    CANNOT RUN WITH NODE 14.17.5
    Electron Packager requires Node 4.0 or above.
    

    OK cool, this is fixed in https://github.com/electron/electron-packager/issues/863.

    I will save anyone who stumbles upon this some time, although these package versions are probably out of date as soon as I hit submit:

      "devDependencies": {
        "electron-packager": "^15.3.0",
        "eslint": "^7.32.0",
        "eslint-config-airbnb": "^18.2.1",
        "eslint-plugin-import": "^2.24.1",
        "eslint-plugin-jsx-a11y": "^6.4.1",
        "eslint-plugin-react": "^7.24.0",
        "eslint-plugin-react-hooks": "^4.2.0",
        "jasmine": "^3.8.0"
      },
      "dependencies": {
        "codemirror": "^5.62.3",
        "electron": "^13.2.1",
        "electron-config": "^2.0.0",
        "electron-context-menu": "^3.1.1",
        "electron-default-menu": "^1.0.2",
        "git-validate": "^2.2.2",
        "is-url": "^1.2.2",
        "jquery": "^3.1.1",
        "js-beautify": "^1.6.4",
        "json5": "^2.2.0",
        "jsonlint": "^1.6.2",
        "menu": "^0.2.5",
        "mkdirp": "^1.0.4",
        "node-jq": ">=0.5.0",
        "proxyquire": "^2.1.3",
        "superagent": "^6.1.0"
      }
    
    

    I got as far as it building again, but the UI doesn't load and the following errors are in Developer Tools

    Uncaught ReferenceError: require is not defined
        at json5-lint.js:3
    index.html:31 Uncaught ReferenceError: require is not defined
        at index.html:31
    jquery-ui.js:14 Uncaught ReferenceError: jQuery is not defined
        at jquery-ui.js:14
        at jquery-ui.js:16
    index.html:67 Uncaught ReferenceError: require is not defined
        at index.html:67
    

    I just wanted to view some JSON and do some filtering.

    opened by voltagex 0
  • JMESPath as jq alternative?

    JMESPath as jq alternative?

    jq's quite nice, but a little confusing, whereas as JMESPath looks like it could be a good secondary option. http://jmespath.org/

    I'm not sure how it'd play with JSON-Splora, but there's a JS implementation: https://github.com/jmespath/jmespath.js/

    opened by davidsharp 1
  • JSON

    JSON "big" files takes ages

    Hello, Loading a 10MB json file takes almost 2 minutes. trying to use the basic JS functions gets the window stack. Is this a known issue? is electron limited in memory regarding parsing a json file?

    thanks.

    opened by pantchox 1
  • Problem installing on OS X 10.11.6, node 7.6.0;

    Problem installing on OS X 10.11.6, node 7.6.0; "command not found: jsplora"

    I'm fairly sure that I'm doing it right, but the odds are against me here.

    » npm i -g json-splora
    
    > [email protected] install /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora/node_modules/git-validate
    > node bin/install
    
    WARNING: Unable to find a .git directory for this project, installation aborted.
    npm WARN engine [email protected]: wanted: {"node":">=0.10.0 <7"} (current: {"node":"7.6.0","npm":"2.15.0"})
    
    > [email protected] postinstall /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora/node_modules/node-jq
    > npm run install-binary
    
    
    > [email protected] install-binary /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora/node_modules/node-jq
    > node scripts/install-binary.js
    
    jq installed successfully on /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora/node_modules/node-jq/bin
    
    > [email protected] postinstall /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora/node_modules/electron
    > node install.js
    
    /usr/local/Cellar/node/7.6.0/bin/jsplora -> /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora/bin/jsplora
    
    > [email protected] install /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora
    > node bin/install
    
    WARNING: Unable to find a package.json for this project, installation aborted.
    [email protected] /usr/local/Cellar/node/7.6.0/lib/node_modules/json-splora
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected] ([email protected], [email protected])
    ├── [email protected] ([email protected])
    ├── [email protected] ([email protected], [email protected])
    ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    ├── [email protected] ([email protected])
    ├── [email protected]
    ├── [email protected] ([email protected], [email protected], [email protected])
    ├── [email protected] ([email protected], [email protected], [email protected])
    ├── [email protected] ([email protected], [email protected])
    ├── [email protected]
    ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
    └── [email protected] ([email protected], [email protected])
    » touch test.json
    » jsplora test.json
    zsh: command not found: jsplora
    
    opened by ianwaldrop 2
Releases(1.0.0)
Owner
Wells Johnston
code and stuff
Wells Johnston
Convert JSON examples into JSON schema (supports Swagger 2, OpenAPI 3 and 3.1)

json-to-json-schema Convert JSON examples into JSON schema. Supports JSON Schema draft-05 used in Swagger 2.0 and OpenAPI 3.0 and new draft draft-2020

Redocly 9 Sep 15, 2022
Schema-Inspector is an JSON API sanitisation and validation module.

Schema-Inspector is a powerful tool to sanitize and validate JS objects. It's designed to work both client-side and server-side and to be scalable wit

null 494 Oct 3, 2022
Tiny Validator for JSON Schema v4

Tiny Validator (for v4 JSON Schema) Use json-schema draft v4 to validate simple values and complex objects using a rich validation vocabulary (example

Geraint 1.2k Dec 21, 2022
This Login Form made using React hooks , React Js , Css, Json. This form have 3 inputs, it also validate those inputs & it also having length limitations.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Yogesh Sharma 0 Jan 3, 2022
A simple and composable way to validate data in JavaScript (and TypeScript).

A simple and composable way to validate data in JavaScript (and TypeScript). Usage • Why? • Principles • Demo • Examples • Documentation Superstruct m

Ian Storm Taylor 6.3k Jan 9, 2023
Themis is a validation and processing library that helps you always make sure your data is correct.

Dataffy Themis - The advanced validation library Themis is a validation and processing library that helps you always make sure your data is correct. ·

Dataffy 14 Oct 27, 2022
The most powerful data validation library for JS

joi The most powerful schema description language and data validator for JavaScript. Installation npm install joi Visit the joi.dev Developer Portal f

Sideway Inc. 19.6k Jan 4, 2023
Fast, compiled, eval-free data validator/transformer

spectypes Fast, compiled, eval-free data validator/transformer Features really fast, can be even faster than ajv detailed errors, failure will result

null 65 Dec 29, 2022
Codestamp - Stamp and verify your files and contents

A language-agnostic tool for signing and verifying your (codegen'd) files and contents.

Keyan Zhang 4 Jan 26, 2022
FieldVal - multipurpose validation library. Supports both sync and async validation.

FieldVal-JS The FieldVal-JS library allows you to easily validate data and provide readable and structured error reports. Documentation and Examples D

null 137 Sep 24, 2022
jQuery library to validate html forms. compatible with bootstrap v4 and bootstrap v3

jQuery form validation jQuery form validation is a library that helps you to validate your HTML form, it's completable with both Bootstrap 3 and Boots

Bassam Nabriss 33 Jun 10, 2021
ForgJs is a javascript lightweight object validator. Go check the Quick start section and start coding with love

Hey every one im really happy that this repo reached this many stars ?? ,but this repo needs your contibution I started to better document the code th

Hamdaoui Oussama 1.7k Dec 21, 2022
:white_check_mark: Easy property validation for JavaScript, Node and Express.

property-validator ✅ Easy property validation for JavaScript, Node and Express Built on top of validator.js, property-validator makes validating reque

Netto Farah 160 Dec 14, 2022
Receipt parser webapplication written in javascript and python.

Receipt Manager Webapp You can find pre-compiled releases on the Github release page. All the needed info about how to use the receipt-manager-webapp

null 37 Nov 27, 2022
Validate properties and well known annotations in your Backstage catalog-info.yaml files.

Backstage entity validator This package can be used as a GitHub action or a standalone node.js module GitHub action Inputs path Optional Path to the c

Roadie 39 Dec 26, 2022
Simple and basic javascript form validations

JavaScript-Form-Validations Simple and basic javascript form validations Table of Validations: S. No. Type of validation Link 1 Non-empty text field h

MAINAK CHAUDHURI 23 Dec 17, 2022