lloyd / JSONSelect

CSS-like selectors for JSON
http://jsonselect.org
ISC License
1.59k stars 116 forks source link

Add a stringify method to format a JSON and returns markers #74

Open yannickglt opened 8 years ago

yannickglt commented 8 years ago

It would allow to both format a JSON as string using a given indentation (like JSON.stringify) and return a list of markers for matching results. A marker is an object { lineStart: number, columnStart: number, lineEnd: number, columnEnd: number } referring to the output formatted JSON.

Markers are helpful for highlighting in a source code editor like CodeMirror for example.

You can see http://yannickglt.github.io/esselect/ to get a preview of the use such a stringify method.