{"_id":"detect-newline","_rev":"180283","name":"detect-newline","description":"Detect the dominant newline character of a string","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-10-18T09:42:28.000Z","created":"2014-06-28T14:34:10.819Z","4.0.0":"2021-10-14T08:16:13.106Z","3.1.0":"2019-11-13T08:43:13.122Z","3.0.0":"2019-04-11T08:25:33.544Z","2.1.0":"2016-02-16T18:42:47.534Z","2.0.1":"2016-02-09T12:52:41.850Z","2.0.0":"2016-02-09T12:42:09.014Z","1.0.3":"2015-02-16T17:31:25.668Z","1.0.2":"2015-01-24T11:57:35.404Z","1.0.1":"2014-08-17T23:43:06.255Z","1.0.0":"2014-08-14T18:23:36.536Z","0.1.1":"2014-06-28T14:59:05.168Z","0.1.0":"2014-06-28T14:34:10.819Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"versions":{"4.0.0":{"name":"detect-newline","version":"4.0.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.45.0"},"gitHead":"dd540459b7b095b82a487e7e47642ed8b946ca55","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline#readme","_id":"detect-newline@4.0.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"shasum":"450ac3f864d5f61112b53a524123b012c59581bc","size":1757,"noattachment":false,"key":"/detect-newline/-/detect-newline-4.0.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-newline_4.0.0_1634199372936_0.5279149495591182"},"_hasShrinkwrap":false,"publish_time":1634199373106,"_cnpm_publish_time":1634199373106,"_cnpmcore_publish_time":"2021-12-13T10:53:31.217Z"},"3.1.0":{"name":"detect-newline","version":"3.1.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"991b31d4ef88471d476f173bdb4e9ab63ea7b85e","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline#readme","_id":"detect-newline@3.1.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"576f5dfc63ae1a192ff192d8ad3af6308991b651","size":1829,"noattachment":false,"key":"/detect-newline/-/detect-newline-3.1.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-newline_3.1.0_1573634592999_0.9999847296708473"},"_hasShrinkwrap":false,"publish_time":1573634593122,"_cnpm_publish_time":1573634593122},"3.0.0":{"name":"detect-newline","version":"3.0.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"c4f3aba414b8bf8b57125f1954f1f8ea9ce11d24","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline#readme","_id":"detect-newline@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"8ae477c089e51872c264531cd6547719c0b86b2f","size":1794,"noattachment":false,"key":"/detect-newline/-/detect-newline-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-newline_3.0.0_1554971133408_0.5989248008934898"},"_hasShrinkwrap":false,"publish_time":1554971133544,"_cnpm_publish_time":1554971133544},"2.1.0":{"name":"detect-newline","version":"2.1.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"6d96229078f55b65e6252dd2c0a42006e6a81833","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline#readme","_id":"detect-newline@2.1.0","_shasum":"f41f1c10be4b00e87b5f13da680759f2c5bfd3e2","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f41f1c10be4b00e87b5f13da680759f2c5bfd3e2","size":1691,"noattachment":false,"key":"/detect-newline/-/detect-newline-2.1.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/detect-newline-2.1.0.tgz_1455648165578_0.057551848934963346"},"directories":{},"publish_time":1455648167534,"_cnpm_publish_time":1455648167534,"_hasShrinkwrap":false},"2.0.1":{"name":"detect-newline","version":"2.0.1","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"54a9b9948dba1e7e6d32534be4f12b3aa64baee5","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline#readme","_id":"detect-newline@2.0.1","_shasum":"3f82607365b3495c48126f8f2f2ae07bb47d5da5","_from":".","_npmVersion":"3.7.2","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3f82607365b3495c48126f8f2f2ae07bb47d5da5","size":1637,"noattachment":false,"key":"/detect-newline/-/detect-newline-2.0.1.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-2.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/detect-newline-2.0.1.tgz_1455022360606_0.058979029301553965"},"directories":{},"publish_time":1455022361850,"_cnpm_publish_time":1455022361850,"_hasShrinkwrap":false},"2.0.0":{"name":"detect-newline","version":"2.0.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/detect-newline.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bin":{"detect-newline":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"9b1adb4c58c87d9bf2c18d83c186094cf5e45ab5","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline#readme","_id":"detect-newline@2.0.0","_shasum":"a72fd0e6b707e8433ead7ff0ae1e3aeabe58fd9e","_from":".","_npmVersion":"3.7.2","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a72fd0e6b707e8433ead7ff0ae1e3aeabe58fd9e","size":1650,"noattachment":false,"key":"/detect-newline/-/detect-newline-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/detect-newline-2.0.0.tgz_1455021727687_0.6424719274509698"},"directories":{},"publish_time":1455021729014,"_cnpm_publish_time":1455021729014,"_hasShrinkwrap":false},"1.0.3":{"name":"detect-newline","version":"1.0.3","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/detect-newline"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"detect-newline":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"dependencies":{"get-stdin":"^4.0.1","minimist":"^1.1.0"},"devDependencies":{"mocha":"*"},"gitHead":"4a94cd938a233e304e11a3a6a0a8f855742fdc07","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline","_id":"detect-newline@1.0.3","_shasum":"e97b1003877d70c09af1af35bfadff168de4920d","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"e97b1003877d70c09af1af35bfadff168de4920d","size":1987,"noattachment":false,"key":"/detect-newline/-/detect-newline-1.0.3.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-1.0.3.tgz"},"directories":{},"publish_time":1424107885668,"_cnpm_publish_time":1424107885668,"_hasShrinkwrap":false},"1.0.2":{"name":"detect-newline","version":"1.0.2","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/detect-newline"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"detect-newline":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"dependencies":{"get-stdin":"^3.0.0","minimist":"^1.1.0"},"devDependencies":{"mocha":"*"},"gitHead":"018a1ca8f0070187c0b4f8aa7748e18d65ecec12","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline","_id":"detect-newline@1.0.2","_shasum":"db250ee12645b60b5229482b8d42b31cd166cb29","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"db250ee12645b60b5229482b8d42b31cd166cb29","size":1289,"noattachment":false,"key":"/detect-newline/-/detect-newline-1.0.2.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-1.0.2.tgz"},"directories":{},"publish_time":1422100655404,"_cnpm_publish_time":1422100655404,"_hasShrinkwrap":false},"1.0.1":{"name":"detect-newline","version":"1.0.1","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/detect-newline"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"detect-newline":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"dependencies":{"get-stdin":"^3.0.0","minimist":"^1.1.0"},"devDependencies":{"mocha":"*"},"gitHead":"63586bdc682814db858c4af1c685f21e63b03e4e","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline","_id":"detect-newline@1.0.1","_shasum":"436f962ea4814b29e8f4d023568d1ffd3c756ca9","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"436f962ea4814b29e8f4d023568d1ffd3c756ca9","size":1291,"noattachment":false,"key":"/detect-newline/-/detect-newline-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-1.0.1.tgz"},"directories":{},"publish_time":1408318986255,"_cnpm_publish_time":1408318986255,"_hasShrinkwrap":false},"1.0.0":{"name":"detect-newline","version":"1.0.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/detect-newline"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"detect-newline":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"dependencies":{"get-stdin":"^2.0.0","minimist":"^1.1.0"},"devDependencies":{"mocha":"*"},"gitHead":"76e7e19f7ce404817de91ce304bc453e27e6c9e1","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline","_id":"detect-newline@1.0.0","_shasum":"c0e44a7af1d11bd2d7b7af82675735a6a685dd62","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"c0e44a7af1d11bd2d7b7af82675735a6a685dd62","size":1293,"noattachment":false,"key":"/detect-newline/-/detect-newline-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-1.0.0.tgz"},"directories":{},"publish_time":1408040616536,"_cnpm_publish_time":1408040616536,"_hasShrinkwrap":false},"0.1.1":{"name":"detect-newline","version":"0.1.1","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/detect-newline"},"bin":{"detect-newline":"cli.js"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"dependencies":{"get-stdin":"^0.1.0","minimist":"^0.2.0"},"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline","_id":"detect-newline@0.1.1","_shasum":"6c4b26a2ff67293c2e6d368263fdd18eccf2d81e","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"6c4b26a2ff67293c2e6d368263fdd18eccf2d81e","size":1281,"noattachment":false,"key":"/detect-newline/-/detect-newline-0.1.1.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-0.1.1.tgz"},"directories":{},"publish_time":1403967545168,"_cnpm_publish_time":1403967545168,"_hasShrinkwrap":false},"0.1.0":{"name":"detect-newline","version":"0.1.0","description":"Detect the dominant newline character of a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/detect-newline"},"bin":{"detect-newline":"cli.js"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","newline","linebreak","line-break","line","lf","crlf","eol","linefeed","character","char"],"dependencies":{"get-stdin":"^0.1.0","minimist":"^0.2.0"},"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"homepage":"https://github.com/sindresorhus/detect-newline","_id":"detect-newline@0.1.0","_shasum":"b86c3a6ff51c9a21619414dd336e0ff93bc34102","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"b86c3a6ff51c9a21619414dd336e0ff93bc34102","size":1286,"noattachment":false,"key":"/detect-newline/-/detect-newline-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/detect-newline/download/detect-newline-0.1.0.tgz"},"directories":{},"publish_time":1403966050819,"_cnpm_publish_time":1403966050819,"_hasShrinkwrap":false}},"readme":"# detect-newline\n\n> Detect the dominant newline character of a string\n\n## Install\n\n```sh\nnpm install detect-newline\n```\n\n## Usage\n\n```js\nimport {detectNewline} from 'detect-newline';\n\ndetectNewline('foo\\nbar\\nbaz\\r\\n');\n//=> '\\n'\n```\n\n## API\n\n### detectNewline(string)\n\nReturns the detected newline or `undefined` when no newline character is found.\n\n### detectNewlineGraceful(unknown)\n\nReturns the detected newline or `\\n` when no newline character is found or the input is not a string.\n\n## Related\n\n- [detect-newline-cli](https://github.com/sindresorhus/detect-newline-cli) - CLI for this module\n- [detect-indent](https://github.com/sindresorhus/detect-indent) - Detect the indentation of code\n","_attachments":{},"homepage":"https://github.com/sindresorhus/detect-newline#readme","bugs":{"url":"https://github.com/sindresorhus/detect-newline/issues"},"license":"MIT"}