dot-wild-tiny
Use powerful dot notation (dot path + wildcard) to access properties of JSON.
If you need to do set or delete, use dot-wild which has all functions.
Table of Contents
Install
$ npm install dot-wild-tiny --save # or $ yarn add dot-wild-tiny
Usage
; /** * Getter */dot;// => 'baz' dot;// => 'baz' dot;// => 'default' const authorData = authors: username: 'tsuyoshiwada' profile: age: 24 username: 'sampleuser' profile: age: 30 username: 'foobarbaz' profile: age: 33 ; dot;// => ['tsuyoshiwada', 'sampleuser', 'foobarbaz'] dot;// => [24, 30, 33] /** * Collection helpers (forEach, map) */dot; dot;// => ['tag 1 === tag 1 (name)', 'tag 2 === tag 2 (name)']
Contribute
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
Bugs, feature requests and comments are more than welcome in the issues.