{"_id":"read-file","_rev":"14-e08e16b933add81eb1bfda1aed11f6e9","name":"read-file","description":"Thin wrapper around fs.readFile and fs.readFileSync that also strips byte order marks when `utf8` encoding is chosen. Also optionally replaces windows newlines with unix newlines.","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"read-file","description":"Lightweight methods for reading from the file system, async and sync, with extras for stripping byte order marks and normalizing newlines.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/read-file","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-file.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-file/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/read-file/blob/master/LICENSE-MIT"}],"keywords":["ascyn","bom","byte order mark","file system","file","fs","newline","normalize","read async","read file","read sync","read","return","sync"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha -R test"},"devDependencies":{"verb":"~0.2.0","chai":"~1.9.1"},"dependencies":{"graceful-fs":"~2.0.3","async":"~0.7.0"},"_id":"read-file@0.1.0","dist":{"shasum":"c448ea5e209bc31dfb6bf5b888e7c8362f6b2867","tarball":"https://registry.npmjs.org/read-file/-/read-file-0.1.0.tgz","integrity":"sha512-MkZoaZd4Dku4onAWZGC4664cSYpFptzubgyYjpgxO0WFrUQ0G6m386NQEgz2BJllbrd7X7kZfPrvWy9DuHoiFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHVYJX8ibb1BykUMICOVWwKWWFW1gUlUv61TWjmrTVK6AiEAo1qiVSWVnadPVTeaNAHVPg94mYjd/yXq7xGJLIA8PQc="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{}},"0.1.1":{"name":"read-file","description":"Lightweight methods for reading from the file system, async and sync, with extras for stripping byte order marks and normalizing newlines.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/read-file","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-file.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-file/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/read-file/blob/master/LICENSE-MIT"}],"keywords":["ascyn","bom","byte order mark","file system","file","fs","newline","normalize","read async","read file","read sync","read","return","sync"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha -R test"},"devDependencies":{"verb":"~0.2.0","chai":"~1.9.1"},"dependencies":{"graceful-fs":"~2.0.3","async":"~0.7.0"},"_id":"read-file@0.1.1","dist":{"shasum":"f55f41a7e84f23e41442921f6158016e6f1ac86e","tarball":"https://registry.npmjs.org/read-file/-/read-file-0.1.1.tgz","integrity":"sha512-79lut+MkpXCosAGzKo2f5lka6i63PpeYvSaPZsR3lp/FemcMhFe8nD3CR1jGjeu8JyUMplJmgjfQK5RGN02YXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRtdyG11Fo96MvJ/2J2wOr1hid3pPx6/ZfDnPnqy5AfQIhAKvs6Tw+htAdaOJOuSyJ8Nu9d4MW1+UsjNu5ip9/+kGq"}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{}},"0.1.2":{"name":"read-file","description":"Lightweight methods for reading from the file system, async and sync.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/read-file","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/read-file.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-file/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/read-file/blob/master/LICENSE-MIT"}],"keywords":["ascyn","bom","byte order mark","file system","file","fs","newline","normalize","read async","read file","read sync","read","return","sync"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha -R test"},"devDependencies":{"verb":"~0.2.0","chai":"~1.9.1"},"dependencies":{"async":"~0.7.0","file-normalize":"^0.1.0","graceful-fs":"~2.0.3"},"_id":"read-file@0.1.2","_shasum":"2e79f2096cc8d20f6680036c6cb7e437541fba5b","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"2e79f2096cc8d20f6680036c6cb7e437541fba5b","tarball":"https://registry.npmjs.org/read-file/-/read-file-0.1.2.tgz","integrity":"sha512-T8U+YYrffCG8+2q6x29PRx65UXYyzv35NUzeGGkMjypQBf3o8eQuPtoREZvx9A0BszSfWuvQRXs+gx3wU8JMCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFoY+bDIN6KEJvmZMyMnDq7VTu8nPMnn2j+4Gi1u0W1GAiBdzN1XRxvGMy2x2y6mXWhUExmtzfv4Zy5y1FxvPG+ObA=="}]},"directories":{}},"0.2.0":{"name":"read-file","description":"Thin wrapper around fs.readFile and fs.readFileSync that also strips byte order marks when `utf8` encoding is chosen. Also optionally replaces windows newlines with unix newlines.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/read-file","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-file.git"},"bugs":{"url":"https://github.com/jonschlinkert/read-file/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha"},"keywords":["bom","file","fs","path","read","util","readfile","readfilesync"],"verb":{"related":{"list":["read-yaml","read-data","write","copy"]}},"gitHead":"dd092bfcca5104a0f4130d57fd179da9d4f28734","_id":"read-file@0.2.0","_shasum":"70c6baf8842ec7d1540f981fd0e6aed4c81bd545","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"70c6baf8842ec7d1540f981fd0e6aed4c81bd545","tarball":"https://registry.npmjs.org/read-file/-/read-file-0.2.0.tgz","integrity":"sha512-na/zgd5KplGlR+io+ygXQMIoDfX/Y0bNS5+P2TOXOTk5plquOVd0snudCd30hZJAsnVK2rxuxUP2z0CN+Aw1lQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAk4sVziJtItJVn+eVcxwnobZkH5iNxrBLVWRR0KTgTzAiEAuA3h/p2ta+WnjkhnYNHkNO2IRPxNtsLB9R7751so23c="}]},"directories":{}}},"readme":"# read-file [![NPM version](https://badge.fury.io/js/read-file.svg)](http://badge.fury.io/js/read-file)\n\n> Thin wrapper around fs.readFile and fs.readFileSync that also strips byte order marks when `utf8` encoding is chosen. Also optionally replaces windows newlines with unix newlines.\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i read-file --save\n```\n\n## Usage\n\n```js\nvar read = require('read-file');\n\n// async\nread('foo.txt', function(err, buffer) {\n  //=> <Buffer 74 68 69 73 20 69 73 20 66 6f 6f>\n});\n\n// sync\nvar buffer = read.sync('foo.txt');\n//=> <Buffer 74 68 69 73 20 69 73 20 66 6f 6f>\n```\n\n### BOM\n\nif `utf8` encoding is used, byte order marks will be stripped\n\n**async**\n\n```js\nread('foo.txt', 'utf8', function(err, buffer) {\n  //=> 'some contents...'\n});\n\n// or\nread('foo.txt', {encoding: 'utf8'} function(err, buffer) {\n  //=> 'some contents...'\n});\n```\n\n**sync**\n\n```js\nread.sync('foo.txt', 'utf8');\n// or\nread('foo.txt', {encoding: 'utf8'});\n```\n\n### options.normalize\n\nPass `{ normalize: true }` on the options to strip windows carriage returns. This will also return a `utf8` string.\n\n## Related projects\n\n* [copy](https://github.com/jonschlinkert/copy): Copy files or directories using globs.\n* [read-yaml](https://github.com/jonschlinkert/read-yaml): Very thin wrapper around js-yaml for directly reading in YAML files.\n* [read-data](https://github.com/jonschlinkert/read-data): Read JSON or YAML files.\n* [write](https://github.com/jonschlinkert/write): Write files to disk, creating intermediate directories if they don't exist.\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/read-file/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 Jon Schlinkert\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 17, 2015._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-26T09:13:21.471Z","created":"2014-04-09T20:14:33.569Z","0.1.0":"2014-04-09T20:14:33.569Z","0.1.1":"2014-04-09T20:48:40.911Z","0.1.2":"2014-06-10T23:35:35.027Z","0.2.0":"2015-07-17T06:47:39.599Z"},"homepage":"https://github.com/jonschlinkert/read-file","keywords":["bom","file","fs","path","read","util","readfile","readfilesync"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-file.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/read-file/issues"},"readmeFilename":"README.md","users":{"tinyhill":true,"andrew.medvedev":true,"kevin-wynn":true,"andreaspizsa":true,"rubiadias":true},"license":"MIT"}