News for hackers. Stuff that matters.
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by nacs on Monday January 16, 2017 @04:27PM (#13413182)
Looks like the HN effect is happening already -- the "Demo" link to Github shows this:

  {
    "message": "API rate limit exceeded for 52.53.190.53. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
    "documentation_url": "https://developer.github.com/v3/#rate-limiting"
  }
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by GordonS on Tuesday January 17, 2017 @04:56AM (#13416249)
I'm colour-blind, and Firefox the text in the console is completely unreadable to me. The Firefox console background is grey (I think), while the text is blue or purple (I think) and I can't make it out against the background.
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by giancarlostoro on Tuesday January 17, 2017 @12:29PM (#13419315)
Just wondering but are you aware that you can change the color scheme of the development tools? Changing the scheme also updates the colors of the console. There's at least 3 themes available as options, not sure if this helps, hoping it does.
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by jordache on Monday January 16, 2017 @06:19PM (#13413920)
Chrome devtools? I feel the collapsed tree visualization of parsed JSON is already sufficient.

I'll just access the API I need within the authentication context of my app. Anything I would want to do with the JSON data is directly available in the devtools console. It has the added benefit of copying/pasting rough code I write in the console into my IDE to continue the work.

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by amw-zero on Monday January 16, 2017 @11:57PM (#13415298)
That gets you decently far, especially with small JSON responses. You can't filter with any tree display though, which is what I normally reach to jq for. Being able to filter an array of objects down to only one property in each object is invaluable to me.

For example, in a JSON payload that has an array of 15 objects, I would like to see all IDs of those objects. The output would be something like [1230, 134, 65, 99]. I like looking at that vs scrolling and collapsing a bunch of objects.

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by jordache on Tuesday January 17, 2017 @07:29AM (#13416895)
write a quick lodash method call to filter your collection.

given the consistent nature of data collections I almost never have a need to examine the full dataset via some front end debugging tool. trust the data to be consistent or not?

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by amw-zero on Thursday January 19, 2017 @08:37AM (#13435622)
Definitely do whatever you think is easier in your workflow. Not everyone uses lodash, but I know a lot of people that prefer to do mapping / filtering of JSON in an actual programming language. That doesn't make one way better or worse than another. 2 ways of accomplishing the same thing.

Not sure what the point about consistency has to do with anything? What if it's an array of consistent, but large objects?

I find I need to examine a full page of JSON quite frequently. I.e. there's some bug, and I need to check for any occurrences of null for a specific property.

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by snug on Monday January 16, 2017 @04:29PM (#13413196)
Pretty cool, but there should be a warning not to enter in API credentials (through the URI) on this page, as the request is proxied to jsonbrowse.com
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by bloated_brain on Monday January 16, 2017 @05:37PM (#13413655)
That's fair. CORS is a bitch.
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by jorde on Monday January 16, 2017 @05:43PM (#13413686)
YEs, CORS is the reason for this and the code for this proxy is open source and very simple[0]. I didn't want to add disclaimers to clutter the UI nor did I wanted to build a browser extension as it would suffer from same trust issues (you still need to trust the extension developer).

For full transparency, the proxy is hosted on Zeit's `now` service and I don't even have access to logs so accidental leaks should be pretty safe.

[0] https://github.com/jorilallo/jsonbrowse-proxy

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by dvcc on Monday January 16, 2017 @06:39PM (#13414051)
By the looks of it, I could just throw at it some response that is massive and it would still attempt to grab it?

If this is really being just run as a proxy setup, the jsonbrowse-proxy might not need the isomorphic-fetch lib, in which case you can just use the embedded node-fetch instead, which has max response size and timeout options available.

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by dpedu on Monday January 16, 2017 @06:11PM (#13413880)
I wrote a similar tool awhile ago, though it runs on the command line.

https://github.com/dpedu2/sless

It's intended for reading structure logs - a file containing json objects separated by newlines.

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by jorde on Monday January 16, 2017 @06:15PM (#13413901)
This is really impressive. Another good JSON tool that I would recommend is jq which has been on HN a few times: https://stedolan.github.io/jq/
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by mjmasn on Tuesday January 17, 2017 @12:39AM (#13415442)
I think the most useful feature here is JSON -> JS conversion. Relatively often I find myself copying and pasting some JSON into a JS file then manually deleting / regexing away the unnecessary quote marks around key names.
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by _ZeD_ on Tuesday January 17, 2017 @02:45AM (#13415775)
strange, I always put quote marks, as I see them as totally necessary. Not in the browser, obviously, but in my mind. It helps me recording those are strings, not variables. I made too many mistakes in the likes of

    var foo = "bar";
    var baz = {
        foo: "qux"
    };
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by vog on Tuesday January 17, 2017 @04:55AM (#13416243)
This bites especially often if you are steadily switching between JavaScript and a server-side language where that code actually does what you expect (e.g. Python).
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by mjmasn on Tuesday January 17, 2017 @08:35AM (#13417343)
I assume you mean you mistakenly expect baz to equal:

    {
        bar: "qux"
    }
?

Don't you use syntax highlighting? I can't imagine this ever being an issue...

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by dathanb82 on Tuesday January 17, 2017 @01:17AM (#13415564)
Other than being idiomatic, is there any advantage to quoting or not quoting key names in JS?
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by mjmasn on Tuesday January 17, 2017 @08:44AM (#13417403)
Minor reasons but a) it looks untidy (to me), and b) for example if I want to change:

    foo = {
        "bar": true,
        "baz": false
    }
to:

    foo.bar = true;
    foo.baz = false;
then I have extra quotes to delete. Those half seconds add up over a year!

I guess you could argue the opposite though, that this looks messy:

    let headers = {
        Expires: 0,
        'Content-Type': 'application/json'
    }
Which leads me to believe it's a matter of personal preference, and you should just pick one and stick to it :) And look, there's even an eslint rule for it: http://eslint.org/docs/rules/quote-props
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by jorde on Tuesday January 17, 2017 @01:50AM (#13415645)
Quoted keys allows more variety in the keys (e.g. "Content-Type") but is more annoying to use if all your JS code is written in camelCase (headers["Content-Type"] vs headers.contentType).
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by yigitozkavci on Tuesday January 17, 2017 @03:19AM (#13415877)
Looks like a nice toy to play with for vim users. I already want to write a macro for it
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by travelton on Monday January 16, 2017 @06:04PM (#13413827)
Updated my jsonlint.com bookmark to jsonbrowse.com. Thanks for the nifty tool!
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by donpdonp on Monday January 16, 2017 @08:39PM (#13414529)
same. i use jsonlint all the time to pretty-print json, but this is faster/easier and a filter language too!
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by ssreeniv on Wednesday January 18, 2017 @05:17AM (#13425314)
Nice tool

Suggestion : Filtering seems to work only on object keys at the outermost level (e.g full_name in demo). It would be nice to be able to filter inner keys as well (e.g html_url in demo)

Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by PretzelFisch on Monday January 16, 2017 @05:05PM (#13413436)
why would I use this over something like postman or RESTClient?
Re:Show HN: JSON Browse – Fetch, filter and manipulate your ... by jorde on Monday January 16, 2017 @05:44PM (#13413694)
JSON Browse is like a glorified JSON prettifier with some `jq` style filtering features and not really a REST client even though it features remote fetching for convenience.