Skip to content

syohex/emacs-json-pointer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-pointer.el

JSON pointer implementation in Emacs Lisp. This is inspired by JSON::Pointer and Mojo::JSON::Pointer

API

(json-pointer-get json path)

Get element by path. json is decoded object by json.el.

Sample code

(let ((json '((foo . 1)
              (bar . [((qux . "hello")) 3])
              (baz . ((boo . [1 3 5 7]))))))
    (json-pointer-get json "/foo")        ;; => 1
    (json-pointer-get json "/bar/0")      ;; =>  '((qux . "hello"))
    (json-pointer-get json "/bar/0/qux")  ;; => "hello"
    (json-pointer-get json "/bar/1")      ;; => 3
    (json-pointer-get json "/baz/boo/2")) ;; => 55

About

JSON pointer implementation in Emacs Lisp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published