Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruanyl/json-value
retrieve value from json with a given keys string "foo.bar.val"
https://github.com/ruanyl/json-value
Last synced: 18 days ago
JSON representation
retrieve value from json with a given keys string "foo.bar.val"
- Host: GitHub
- URL: https://github.com/ruanyl/json-value
- Owner: ruanyl
- License: mit
- Created: 2014-12-31T22:02:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-31T22:49:25.000Z (about 10 years ago)
- Last Synced: 2024-12-05T18:06:38.753Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
json-value
========
[![build status](https://secure.travis-ci.org/ruanyl/json-value.svg)](http://travis-ci.org/ruanyl/json-value)
[![NPM version](https://badge.fury.io/js/json-value.svg)](http://badge.fury.io/js/json-value)retrieve value from json with a given keys string "foo.bar.val"
## Installation
This module is installed via npm:
``` bash
$ npm install json-value
```## Example Usage
``` js
var jsonValue = require('json-value');var json = {
foo: '123',
bar: {
name: 'ruan',
age: 12
}
};jsonValue(json, 'bar.name'); //shoud be 'ruan'
```