Sha256: 333d4c68c9e7aeb436529e88b5793ca13406d01ac192911f25c44a493500a294
Contents?: true
Size: 1.78 KB
Versions: 2
Compression:
Stored size: 1.78 KB
Contents
# read-json-sync [](https://www.npmjs.com/package/read-json-sync) [](https://travis-ci.org/shinnn/read-json-sync) [](https://ci.appveyor.com/project/ShinnosukeWatanabe/read-json-sync) [](https://david-dm.org/shinnn/read-json-sync) [](https://david-dm.org/shinnn/read-json-sync) [](https://david-dm.org/shinnn/read-json-sync#info=devDependencies) A [Node](http://nodejs.org/) module to read and parse a JSON file synchronously ```javascript var readJsonSync = require('read-json-sync'); readJsonSync('package.json'); //=> {name: 'read-json-sync', version: '1.0.0', ...} ``` Node's built-in [`require`](http://nodejs.org/api/globals.html#globals_require) can do almost the same thing, but this module doesn't [cache](http://nodejs.org/api/modules.html#modules_caching) results. ## Installation [Use npm](https://docs.npmjs.com/cli/install). ```sh npm install read-json-sync ``` ## API ```javascript var readJsonSync = require('read-json-sync'); ``` ### readJsonSync(*filePath* [, *options*]) *filePath*: `String` (path to a JSON file) *options*: `Object` ([`fs.readFile`](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) options) Return: `Object` (parsed JSON data) ## License Copyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn) Licensed under [the MIT License](./LICENSE).
Version data entries
2 entries across 2 versions & 1 rubygems