{"_id":"file-normalize","_rev":"69665","name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM.","dist-tags":{"latest":"1.1.2"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"time":{"modified":"2021-06-03T10:23:03.000Z","created":"2014-06-10T23:24:39.387Z","1.1.2":"2017-08-01T16:42:11.569Z","1.1.1":"2017-04-19T23:04:45.102Z","1.1.0":"2017-03-30T04:05:11.106Z","1.0.0":"2017-03-29T21:15:00.362Z","0.1.1":"2014-06-11T00:08:58.268Z","0.1.0":"2014-06-10T23:24:39.387Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/file-normalize.git"},"versions":{"1.1.2":{"name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM.","version":"1.1.2","homepage":"https://github.com/jonschlinkert/file-normalize","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"contributors":[{"name":"Blaine Bublitz","url":"https://twitter.com/BlaineBublitz"},{"name":"Brian Woodward","url":"https://twitter.com/doowb"},{"name":"Jon Schlinkert","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/file-normalize.git"},"bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"append-buffer":"^1.0.1","append-string":"^1.0.1","buffer-equal":"^1.0.0","is-buffer":"^1.1.5","normalize-path":"^2.1.1","remove-bom-buffer":"^3.0.0","strip-bom-string":"^1.0.0"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["bom","byte","encoding","eol","file","mark","newline","normalize","order","path","string","utf8"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["fs-utils","normalize-path","parse-filepath"]},"lint":{"reflinks":true}},"gitHead":"3e95666294fd9c98e0355315eb3deed1edafbb4f","_id":"file-normalize@1.1.2","_shasum":"925eb3eca23b8cb6be17df609b1453552b680169","_from":".","_npmVersion":"4.6.1","_nodeVersion":"6.10.1","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"925eb3eca23b8cb6be17df609b1453552b680169","size":4018,"noattachment":false,"key":"/file-normalize/-/file-normalize-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-normalize/download/file-normalize-1.1.2.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-normalize-1.1.2.tgz_1501605730559_0.5089212383609265"},"directories":{},"publish_time":1501605731569,"_cnpm_publish_time":1501605731569,"_hasShrinkwrap":false},"1.1.1":{"name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM.","version":"1.1.1","homepage":"https://github.com/jonschlinkert/file-normalize","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com","url":"https://twitter.com/BlaineBublitz"},{"name":"Brian Woodward","email":"brian.woodward@gmail.com","url":"https://twitter.com/doowb"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/file-normalize.git"},"bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"buffer-equal":"^1.0.0","is-buffer":"^1.1.5","normalize-path":"^2.1.1","strip-bom-buffer":"^1.0.0","strip-bom-string":"^1.0.0"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["bom","byte","encoding","eol","file","mark","newline","normalize","order","path","string","utf8"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["fs-utils","normalize-path","parse-filepath"]},"lint":{"reflinks":true}},"gitHead":"35765ea0aa6252a753a578862ee5871823b56265","_id":"file-normalize@1.1.1","_shasum":"5baa5dcf4a30a6211e8fd96be86981ce8240f3b7","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"5baa5dcf4a30a6211e8fd96be86981ce8240f3b7","size":4193,"noattachment":false,"key":"/file-normalize/-/file-normalize-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-normalize/download/file-normalize-1.1.1.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/file-normalize-1.1.1.tgz_1492643084224_0.0037169477436691523"},"directories":{},"publish_time":1492643085102,"_cnpm_publish_time":1492643085102,"_hasShrinkwrap":false},"1.1.0":{"name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM.","version":"1.1.0","homepage":"https://github.com/jonschlinkert/file-normalize","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"contributors":[{"name":"Brian Woodward","email":"brian.woodward@gmail.com","url":"https://twitter.com/doowb"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/file-normalize.git"},"bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"buffer-equal":"^1.0.0","is-buffer":"^1.1.5","normalize-path":"^2.1.1","strip-bom-buffer":"^1.0.0","strip-bom-string":"^1.0.0"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["bom","byte","encoding","eol","file","mark","newline","normalize","order","path","string","utf8"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["fs-utils","normalize-path","parse-filepath"]},"lint":{"reflinks":true}},"gitHead":"5194f19f05e556e32843c2cb4409a097ae75c992","_id":"file-normalize@1.1.0","_shasum":"e962321b10ca56b0c61d5d63b6829b956c35fccf","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"e962321b10ca56b0c61d5d63b6829b956c35fccf","size":4097,"noattachment":false,"key":"/file-normalize/-/file-normalize-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-normalize/download/file-normalize-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/file-normalize-1.1.0.tgz_1490846709003_0.5934330660384148"},"directories":{},"publish_time":1490846711106,"_cnpm_publish_time":1490846711106,"_hasShrinkwrap":false},"1.0.0":{"name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/file-normalize","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/file-normalize.git"},"bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"buffer-equal":"^1.0.0","normalize-path":"^2.0.1","strip-bom-string":"^0.1.2"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["bom","byte","encoding","eol","file","mark","newline","normalize","order","path","string","utf8"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["fs-utils","normalize-path","parse-filepath"]},"lint":{"reflinks":true}},"gitHead":"eda520d9d5a257d1e238922c98c4ea480f5edbeb","_id":"file-normalize@1.0.0","_shasum":"18fbfdd0d00b86921651ec80573871426163616c","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.1","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"18fbfdd0d00b86921651ec80573871426163616c","size":3900,"noattachment":false,"key":"/file-normalize/-/file-normalize-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-normalize/download/file-normalize-1.0.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/file-normalize-1.0.0.tgz_1490822099714_0.5543854569550604"},"directories":{},"publish_time":1490822100362,"_cnpm_publish_time":1490822100362,"_hasShrinkwrap":false},"0.1.1":{"name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM. ","version":"0.1.1","homepage":"https://github.com/jonschlinkert/file-normalize","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/file-normalize.git"},"bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/file-normalize/blob/master/LICENSE-MIT"}],"keywords":["bom","byte","encoding","eol","file","mark","newline","normalize","order","path","string","utf8"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*","verb-tag-jscomments":"^0.1.0"},"_id":"file-normalize@0.1.1","_shasum":"f4e00866dafff9294d74a4ec6b5b1bb0f22b6c62","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"f4e00866dafff9294d74a4ec6b5b1bb0f22b6c62","size":3060,"noattachment":false,"key":"/file-normalize/-/file-normalize-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-normalize/download/file-normalize-0.1.1.tgz"},"directories":{},"publish_time":1402445338268,"_cnpm_publish_time":1402445338268,"_hasShrinkwrap":false},"0.1.0":{"name":"file-normalize","description":"File system utils for normalizing things like eol, encoding and BOM. ","version":"0.1.0","homepage":"https://github.com/jonschlinkert/file-normalize","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/file-normalize.git"},"bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/file-normalize/blob/master/LICENSE-MIT"}],"keywords":["bom","byte","encoding","eol","file","mark","newline","normalize","order","path","string","utf8"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*","verb-tag-jscomments":"^0.1.0"},"_id":"file-normalize@0.1.0","_shasum":"1522220b0e2d8d1040ab4ab3f54f476a3acb9711","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"1522220b0e2d8d1040ab4ab3f54f476a3acb9711","size":3000,"noattachment":false,"key":"/file-normalize/-/file-normalize-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-normalize/download/file-normalize-0.1.0.tgz"},"directories":{},"publish_time":1402442679387,"_cnpm_publish_time":1402442679387,"_hasShrinkwrap":false}},"readme":"# file-normalize [![NPM version](https://img.shields.io/npm/v/file-normalize.svg?style=flat)](https://www.npmjs.com/package/file-normalize) [![NPM monthly downloads](https://img.shields.io/npm/dm/file-normalize.svg?style=flat)](https://npmjs.org/package/file-normalize)  [![NPM total downloads](https://img.shields.io/npm/dt/file-normalize.svg?style=flat)](https://npmjs.org/package/file-normalize) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/file-normalize.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/file-normalize) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/file-normalize.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/file-normalize)\n\n> File system utils for normalizing things like eol, encoding and BOM.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save file-normalize\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add file-normalize\n```\n\n## API\n\n### [.normalizeSlash](index.js#L37)\n\nNormalize slashes in the given filepath to forward slashes. Note that this is a simple replacement of `\\\\` with `/`, and this method does not check for URL or windows drive characters.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\nvar file = require('file-normalize');\nconsole.log(file.normalizeSlash('foo\\\\bar'));\n//=> 'foo/bar'\n```\n\n### [.normalizeEOL](index.js#L59)\n\nNormalize line endings to use the given `eol` character, or the defaults of the current operating system.\n\n**Params**\n\n* `str` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\nvar fs = require('fs');\nvar file = require('file-normalize');\nvar str = fs.readFileSync('foo.txt', 'utf8');\nconsole.log(file.normalizeEOL(str));\n```\n\n### [.normalizeNL](index.js#L80)\n\nNormalize all line endings to unix newlines (strips carriage returns).\n\n**Params**\n\n* `str` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\nvar fs = require('fs');\nvar file = require('file-normalize');\nvar str = fs.readFileSync('foo.txt', 'utf8');\nconsole.log(file.normalizeNL(str));\n```\n\n### [.stripBOM](index.js#L101)\n\nStrip byte-order marks.\n\n**Params**\n\n* `val` **{String|Buffer}**\n* `returns` **{String}**\n\n**Example**\n\n```js\nvar fs = require('fs');\nvar file = require('file-normalize');\nvar str = file.readFileSync('foo.txt', 'utf8');\nconsole.log(file.stripBOM(str));\n```\n\n### [.append](index.js#L141)\n\nAppend a string or buffer to another string or buffer ensuring to preserve line ending characters.\n\n**Params**\n\n* `prefix` **{String|Buffer}**: String or Buffer that will be used to check for an existing line ending. The suffix is appended to this.\n* `suffix` **{String|Buffer}**: String or Buffer that will be appended to the prefix.\n* `returns` **{String|Buffer}**: Final String or Buffer\n\n**Example**\n\n```js\nconsole.log([append(new Buffer('abc\\r\\n'), new Buffer('def')).toString()]);\n//=> [ 'abc\\r\\ndef\\r\\n' ]\n\nconsole.log([append(new Buffer('abc\\n'), new Buffer('def')).toString()]);\n//=> [ 'abc\\ndef\\n' ]\n\n// uses os.EOL when a line ending is not found\nconsole.log([append(new Buffer('abc'), new Buffer('def')).toString()]);\n//=> [ 'abc\\ndef' ]\n\nconsole.log([append('abc\\r\\n', 'def')]);\n//=> [ 'abc\\r\\ndef\\r\\n' ]\n\nconsole.log([append('abc\\n', 'def')]);\n//=> [ 'abc\\ndef\\n' ]\n\n// uses os.EOL when a line ending is not found\nconsole.log([append('abc', 'def')]);\n//=> [ 'abc\\ndef' ]\n```\n\n### [.appendString](index.js#L168)\n\nAppend a string to another string ensuring to preserve line ending characters.\n\n**Params**\n\n* `str` **{String}**: String that will be used to check for an existing line ending. The suffix is appended to this.\n* `suffix` **{String}**: String that will be appended to the str.\n* `returns` **{String}**: Final String\n\n**Example**\n\n```js\nconsole.log([appendString('abc\\r\\n', 'def')]);\n//=> [ 'abc\\r\\ndef\\r\\n' ]\n\nconsole.log([appendString('abc\\n', 'def')]);\n//=> [ 'abc\\ndef\\n' ]\n\n// uses os.EOL when a line ending is not found\nconsole.log([appendString('abc', 'def')]);\n//=> [ 'abc\\ndef' ]\n```\n\n### [.appendBuffer](index.js#L190)\n\nAppend a buffer to another buffer ensuring to preserve line ending characters.\n\n**Params**\n\n* `buf` **{Buffer}**: Buffer that will be used to check for an existing line ending. The suffix is appended to this.\n* `suffix` **{Buffer}**: Buffer that will be appended to the buf.\n* `returns` **{Buffer}**: Final Buffer\n\n**Example**\n\n```js\nconsole.log([appendBuffer(new Buffer('abc\\r\\n'), new Buffer('def')).toString()]);\n//=> [ 'abc\\r\\ndef\\r\\n' ]\n\nconsole.log([appendBuffer(new Buffer('abc\\n'), new Buffer('def')).toString()]);\n//=> [ 'abc\\ndef\\n' ]\n\n// uses os.EOL when a line ending is not found\nconsole.log([appendBuffer(new Buffer('abc'), new Buffer('def')).toString()]);\n//=> [ 'abc\\ndef' ]\n```\n\n## About\n\n### Related projects\n\n* [fs-utils](https://www.npmjs.com/package/fs-utils): fs extras and utilities to extend the node.js file system module. Used in Assemble and… [more](https://github.com/assemble/fs-utils) | [homepage](https://github.com/assemble/fs-utils \"fs extras and utilities to extend the node.js file system module. Used in Assemble and many other projects.\")\n* [normalize-path](https://www.npmjs.com/package/normalize-path): Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a… [more](https://github.com/jonschlinkert/normalize-path) | [homepage](https://github.com/jonschlinkert/normalize-path \"Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.\")\n* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath \"Pollyfill for node.js `path.parse`, parses a filepath into an object.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 15 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 6  | [doowb](https://github.com/doowb) |  \n| 1  | [phated](https://github.com/phated) |  \n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 01, 2017._","_attachments":{},"homepage":"https://github.com/jonschlinkert/file-normalize","bugs":{"url":"https://github.com/jonschlinkert/file-normalize/issues"},"license":"MIT"}