{"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"}],"dist":{"shasum":"e962321b10ca56b0c61d5d63b6829b956c35fccf","tarball":"http://registry-npm.ywwl.com/file-normalize/download/file-normalize-1.1.0.tgz","integrity":"sha512-FszWTJgx/HgNsUWzfPNVLxMB8n+L5r0jQ/WLr3XW1x800oiSpeKHdUOMIySolTx4H59Whn1endRpoYRXP5xn5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyhpxhI4KqRC+SItIvPXU+duExszj02uWVXPou4kGEGAiAwHFkzVOH3efu5uPAWH3RFaonusvaNXHRSP3yylJcnnQ=="}],"size":4097,"noattachment":false,"key":"/file-normalize/-/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":{},"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._","publish_time":1490846711106,"_cnpm_publish_time":1490846711106,"dist-tags":{"latest":"1.1.2"}}