{"_id":"read-json-sync","_rev":"56534","name":"read-json-sync","description":"Read and parse a JSON file synchronously","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"time":{"modified":"2021-06-03T10:17:13.000Z","created":"2014-10-09T14:08:36.194Z","2.0.1":"2018-12-16T13:00:12.132Z","2.0.0":"2017-11-15T23:33:53.485Z","2.0.0-3":"2017-11-14T05:05:29.015Z","2.0.0-2":"2017-11-10T03:04:54.486Z","2.0.0-1":"2017-09-13T09:26:03.060Z","2.0.0-0":"2017-08-13T14:04:25.706Z","1.1.1":"2015-12-04T19:18:06.866Z","1.1.0":"2015-02-20T08:14:37.633Z","1.0.0":"2014-10-09T14:08:36.194Z"},"users":{},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"versions":{"2.0.1":{"name":"read-json-sync","version":"2.0.1","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"license":"ISC","scripts":{"bench":"node benchmark/runner string-slice && node benchmark/runner string-replace && node benchmark/runner buffer-string-slice","pretest":"eslint .","test":"nyc node test/test.js"},"keywords":["data","json","file","read","load","bom","parse","synchronous","synchronously","sync"],"devDependencies":{"@shinnn/eslint-config":"^6.8.7","chalk":"^2.4.1","eslint":"^5.10.0","nyc":"^13.1.0","nyc-config-common":"^1.0.1","tape":"^4.9.1"},"eslintConfig":{"extends":"@shinnn"},"nyc":{"extends":"nyc-config-common"},"gitHead":"4bbbe43750dec0ae4d101769b9b4d38aa7e573d3","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@2.0.1","_npmVersion":"6.5.0","_nodeVersion":"11.4.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"3f3107bc485c6be7317bd9a6feb3331e9993ea03","size":2491,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-2.0.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-json-sync_2.0.1_1544965211968_0.7205293821099812"},"_hasShrinkwrap":false,"publish_time":1544965212132,"_cnpm_publish_time":1544965212132},"2.0.0":{"name":"read-json-sync","version":"2.0.0","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"bench":"node benchmark/runner string-slice && node benchmark/runner string-replace && node benchmark/runner buffer-string-slice","pretest":"eslint --fix --format=codeframe benchmark index.js test","test":"istanbul cover test/test.js"},"license":"ISC","files":["index.js"],"keywords":["data","json","file","read","load","bom","parse","synchronous","synchronously","sync"],"dependencies":{"graceful-fs":"^4.1.11"},"devDependencies":{"@shinnn/eslint-config-node":"^4.0.2","chalk":"^2.3.0","eslint":"^4.11.0","istanbul":"^0.4.5","tape":"^4.8.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"7f33aaed54bde97b988e37be62ac40df8a0c1d10","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"9.2.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"3a70d68f14c9b83047a460a105489eb3735bfe00","size":2565,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-2.0.0.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-json-sync-2.0.0.tgz_1510788833412_0.23487907904200256"},"directories":{},"publish_time":1510788833485,"_hasShrinkwrap":false,"_cnpm_publish_time":1510788833485},"2.0.0-3":{"name":"read-json-sync","version":"2.0.0-3","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"bench":"node benchmark/runner string-slice && node benchmark/runner string-replace && node benchmark/runner buffer-string-slice","pretest":"eslint --fix --format=codeframe benchmark index.js test","test":"istanbul cover test/test.js"},"license":"CC0-1.0","files":["index.js"],"keywords":["data","json","file","read","load","parse","synchronous","synchronously","sync"],"dependencies":{"graceful-fs":"^4.1.11"},"devDependencies":{"@shinnn/eslint-config-node":"^4.0.2","chalk":"^2.3.0","eslint":"^4.11.0","istanbul":"^0.4.5","tape":"^4.8.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"322364393b15d74f006c7fc3780caa3a6838b138","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@2.0.0-3","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"0c2f6e2aa951158b6df6721651b9fce244c218d0","size":2106,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-2.0.0-3.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-2.0.0-3.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-json-sync-2.0.0-3.tgz_1510635928887_0.3584493272937834"},"directories":{},"publish_time":1510635929015,"_hasShrinkwrap":false,"_cnpm_publish_time":1510635929015},"2.0.0-2":{"name":"read-json-sync","version":"2.0.0-2","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"bench":"node benchmark/runner string-slice && node benchmark/runner string-replace && node benchmark/runner buffer-string-slice","pretest":"eslint --fix --format=codeframe benchmark index.js test","test":"istanbul cover test/test.js"},"license":"CC0-1.0","files":["index.js"],"keywords":["data","json","file","read","load","parse","synchronous","synchronously","sync"],"dependencies":{"graceful-fs":"^4.1.11"},"devDependencies":{"@shinnn/eslint-config-node":"^4.0.2","chalk":"^2.3.0","eslint":"^4.10.0","istanbul":"^0.4.5","tape":"^4.8.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"7c49c794d496e4ae9e636acd0de6cb28145e2553","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@2.0.0-2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"432087fe34619e93f23af612e455879e4f78ec3e","size":1695,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-2.0.0-2.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-2.0.0-2.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-json-sync-2.0.0-2.tgz_1510283094401_0.08672054624184966"},"directories":{},"publish_time":1510283094486,"_cnpm_publish_time":1510283094486,"_hasShrinkwrap":false},"2.0.0-1":{"name":"read-json-sync","version":"2.0.0-1","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --format=codeframe index.js test/test.js","test":"istanbul cover test/test.js"},"license":"CC0-1.0","files":["index.js"],"keywords":["data","json","file","read","load","parse","synchronous","synchronously","sync"],"dependencies":{"graceful-fs":"^4.1.11"},"devDependencies":{"@shinnn/eslint-config-node":"^4.0.2","eslint":"^4.6.1","istanbul":"^0.4.5","tape":"^4.8.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"c778fb9ff480d2747597a53fed015161f06d977a","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@2.0.0-1","_npmVersion":"5.4.1","_nodeVersion":"8.5.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"307fc82bcb0cbd6da86ac4b910fee32a4b41e824","size":1431,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-2.0.0-1.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-2.0.0-1.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-json-sync-2.0.0-1.tgz_1505294762975_0.35565764969214797"},"directories":{},"publish_time":1505294763060,"_hasShrinkwrap":false,"_cnpm_publish_time":1505294763060},"2.0.0-0":{"name":"read-json-sync","version":"2.0.0-0","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --format=codeframe index.js test/test.js","test":"node --throw-deprecation --track-heap-objects test/test.js | tap-spec","coverage":"istanbul cover test/test.js"},"license":"CC0-1.0","files":["index.js"],"keywords":["data","json","file","read","load","parse","synchronous","synchronously","sync"],"dependencies":{"graceful-fs":"^4.1.11"},"devDependencies":{"@shinnn/eslint-config-node":"^4.0.2","eslint":"^4.4.1","istanbul":"^0.4.5","tap-spec":"^4.1.1","tape":"^4.8.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"1038e4c2af31dec5409b5d87aa6c38bb39aa0214","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@2.0.0-0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"d1fa98316083f9e73bc1c4bab31747c486c9edba","size":1363,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-2.0.0-0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-2.0.0-0.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-json-sync-2.0.0-0.tgz_1502633065632_0.07025285460986197"},"directories":{},"publish_time":1502633065706,"_hasShrinkwrap":false,"_cnpm_publish_time":1502633065706},"1.1.1":{"name":"read-json-sync","version":"1.1.1","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"git+https://github.com/shinnn/read-json-sync.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --config @shinnn/node-legacy index.js test/test.js","test":"node --strong_mode --throw-deprecation --track-heap-objects test/test.js | tap-spec","coverage":"node --strong_mode node_modules/.bin/istanbul cover test/test.js"},"license":"MIT","files":["index.js"],"keywords":["data","json","file","read","load","parse","synchronous","synchronously","sync"],"dependencies":{"graceful-fs":"^4.1.2"},"devDependencies":{"@shinnn/eslint-config-node-legacy":"^1.0.0","eslint":"^1.7.3","istanbul":"^0.4.0","tap-spec":"^4.1.0","tape":"^4.2.2"},"gitHead":"0999728ef395e327129fa5754c3f9d8d6040188b","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync#readme","_id":"read-json-sync@1.1.1","_shasum":"43c669ae864aae308dfbbb2721a67e295ec8fff6","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"43c669ae864aae308dfbbb2721a67e295ec8fff6","size":2068,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-1.1.1.tgz"},"directories":{},"publish_time":1449256686866,"_cnpm_publish_time":1449256686866,"_hasShrinkwrap":false},"1.1.0":{"name":"read-json-sync","version":"1.1.0","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"https://github.com/shinnn/read-json-sync"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"jscs index.js test/*.js && eslint index.js test/*.js","test":"node test/test.js | tap-spec","coverage":"istanbul cover test/test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/read-json-sync/blob/master/LICENSE"}],"files":["index.js"],"keywords":["json","file","read","parse","synchronous","sync"],"dependencies":{"graceful-fs":"^3.0.5"},"devDependencies":{"eslint":"^0.14.1","istanbul":"^0.3.6","istanbul-coveralls":"^1.0.1","jscs":"^1.11.3","tap-spec":"^2.2.1","tape":"^3.5.0"},"jscsConfig":{"preset":"google","maximumLineLength":98,"requireBlocksOnNewline":true,"validateLineBreaks":"LF"},"gitHead":"d0ff0b5375a6928bb39648c7a9ba7fa911635772","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync","_id":"read-json-sync@1.1.0","_shasum":"8d597a6a3ba0bf550e4fe39b76da310ab9bd56e9","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.2.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"8d597a6a3ba0bf550e4fe39b76da310ab9bd56e9","size":2129,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-1.1.0.tgz"},"directories":{},"publish_time":1424420077633,"_cnpm_publish_time":1424420077633,"_hasShrinkwrap":false},"1.0.0":{"name":"read-json-sync","version":"1.0.0","description":"Read and parse a JSON file synchronously","repository":{"type":"git","url":"https://github.com/shinnn/read-json-sync"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/read-json-sync/blob/master/LICENSE"}],"files":["index.js","LICENSE"],"keywords":["json","virtual","file","parse","synchronous","sync"],"devDependencies":{"eslint":"^0.8.2","istanbul":"^0.3.2","istanbul-coveralls":"^1.0.0","jscs":"^1.6.2","require-main":"^0.1.1","tap-spec":"^1.0.0","tape":"^3.0.0"},"gitHead":"20b136c93b6744bc6a38e83bc8254887ba037531","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"homepage":"https://github.com/shinnn/read-json-sync","_id":"read-json-sync@1.0.0","_shasum":"1858a54b248a98fe732930c61dd2fd77b51e693f","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.32","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"1858a54b248a98fe732930c61dd2fd77b51e693f","size":2106,"noattachment":false,"key":"/read-json-sync/-/read-json-sync-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-json-sync/download/read-json-sync-1.0.0.tgz"},"directories":{},"publish_time":1412863716194,"_cnpm_publish_time":1412863716194,"_hasShrinkwrap":false}},"readme":"# read-json-sync\n\n[![npm version](https://img.shields.io/npm/v/read-json-sync.svg)](https://www.npmjs.com/package/read-json-sync)\n[![Build Status](https://travis-ci.com/shinnn/read-json-sync.svg?branch=master)](https://travis-ci.com/shinnn/read-json-sync)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/read-json-sync.svg)](https://coveralls.io/github/shinnn/read-json-sync)\n\nA [Node.js](https://nodejs.org/) module to read and parse a [JSON](https://json.org/) file synchronously\n\n```javascript\nconst readJsonSync = require('read-json-sync');\n\nreadJsonSync('package.json'); //=> {name: 'read-json-sync', version: '1.0.0', ...}\n```\n\nNode.js built-in [`require`](https://nodejs.org/api/globals.html#globals_require) and [`import`](https://nodejs.org/api/esm.html#esm_interop_with_existing_modules) can do almost the same thing, but this module doesn't [cache](https://nodejs.org/api/modules.html#modules_caching) results.\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).\n\n```\nnpm install read-json-sync\n```\n\n## API\n\n```javascript\nconst readJsonSync = require('read-json-sync');\n```\n\n### readJsonSync(*path* [, *options*])\n\n*path*: `string` [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer) [`URL`](https://nodejs.org/api/url.html#url_class_url) (JSON filename) or `integer` (file descriptor)  \n*options*: `Object` `string` ([`fs.readFile`](https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback) options or an encoding of the file)  \nReturn: `any` (parsed [JSON](https://tools.ietf.org/html/rfc7159) data)\n\nIt automatically ignores the leading [byte order mark](https://unicode.org/faq/utf_bom.html).\n\n```javascript\n// with-bom.json: '\\uFEFF{\"a\": 1}'\n\nJSON.parse('\\uFEFF{\"a\": 1}'); // throws a SyntaxError\n\nreadJsonSync('with-bom.json'); //=> {a: 1}\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 - 2018 Shinnosuke Watanabe\n","_attachments":{},"homepage":"https://github.com/shinnn/read-json-sync#readme","bugs":{"url":"https://github.com/shinnn/read-json-sync/issues"},"license":"ISC"}