triggerdotdev / jsonhero-web

JSON Hero is an open-source, beautiful JSON explorer for the web that lets you browse, search and navigate your JSON files at speed. 🚀. Built with 💜 by the Trigger.dev team.
https://jsonhero.io
Apache License 2.0
9.01k stars 482 forks source link

Copy path of a selected node #165

Open qkxie opened 1 year ago

qkxie commented 1 year ago

Hope there is a feature to copy the path of the selected in the format of a target language.

for example:

{"a": {"b": {"c": 1}}}

In Python, the copied value should be: root['a']['b']['c']

In JavaScript, the copied value should be: root.a.b.c

changdy commented 1 year ago

It is a good idea . and very useful

Maximization commented 9 months ago

Yes! This is exactly what I'm looking for. My use case is to paste a deeply nested object in JSON Hero, navigate to the value I want through the UI, and would love to copy with a single click the JavaScript I need to use to get that value programatically.

qkxie commented 9 months ago

I posted this issue 3 months ago, but the author hasn't even replied to me, let alone started developing this feature.

CrudeCreations commented 3 months ago

I posted this issue 3 months ago, but the author hasn't even replied to me, let alone started developing this feature.

These guys also have a full time job, the code's open source and if you really need a feature you can write it yourself and make a PR. Here I threw one togethere for you.

I've added a 'Copy Path' button that lets you copy in JS or Python at the moment. Use my fork until they add this feature if you're desperate.