1.0.1 • Published 8 years ago

read-search-json v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

Read and Search JSON

A node module to read and search out JSON data from an input JSON file('*.json'). Inputs are the JSON file path and a Search Path contructed as a string array of Keys. The Search Path can by an Empty array, in that case this module will return entire file data. The last parameter of the module is the returned function handle, that can be invocked to fetch the returned JSON data. If specified file is not present the returned function handle will contain Error in JSON format instead of the actual data.

Installation

npm install read-search-json

Usage

var rsj = require('read-search-json');

rsj.readJSON("<json file with path>",[<"str_1,"str_2",...,"str_n">],function(data,err){
    if(data)
        console.log(data);
    if(err)
        console.log(err);
})

Tests

not applicable

Contributing