{"_id":"read-file","_rev":"60283","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"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:20:24.000Z","created":"2014-04-09T20:14:33.569Z","0.2.0":"2015-07-17T06:47:39.599Z","0.1.2":"2014-06-10T23:35:35.027Z","0.1.1":"2014-04-09T20:48:40.911Z","0.1.0":"2014-04-09T20:14:33.569Z"},"users":{"tinyhill":true,"andrew.medvedev":true,"kevin-wynn":true,"andreaspizsa":true,"rubiadias":true},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/read-file.git"},"versions":{"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","size":2472,"noattachment":false,"key":"/read-file/-/read-file-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-file/download/read-file-0.2.0.tgz"},"directories":{},"publish_time":1437115659599,"_cnpm_publish_time":1437115659599,"_hasShrinkwrap":false},"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","size":3259,"noattachment":false,"key":"/read-file/-/read-file-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-file/download/read-file-0.1.2.tgz"},"directories":{},"publish_time":1402443335027,"_cnpm_publish_time":1402443335027,"_hasShrinkwrap":false},"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","size":3568,"noattachment":false,"key":"/read-file/-/read-file-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-file/download/read-file-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1397076520911,"_cnpm_publish_time":1397076520911,"_hasShrinkwrap":false},"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","size":3549,"noattachment":false,"key":"/read-file/-/read-file-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-file/download/read-file-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1397074473569,"_cnpm_publish_time":1397074473569,"_hasShrinkwrap":false}},"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._","_attachments":{},"homepage":"https://github.com/jonschlinkert/read-file","bugs":{"url":"https://github.com/jonschlinkert/read-file/issues"},"license":"MIT"}