read-search-json

1.0.1 • Public • Published

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

/read-search-json/

    Package Sidebar

    Install

    npm i read-search-json

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Last publish

    Collaborators

    • tanushreepaul