detect-line-endings

0.0.2 • Public • Published

detect-line-endings

build status

This is a utility that will return the platform and line ending character for a given string

It returns an object with properties, 'platform' and 'EOL';

var fs = require('fs');
var detect = require('detect-line-endings');
var dos = fs.readFileSync(__dirname+'/dos');
 
assert.equal(dos, {platform: 'dos', EOL: '\r\n'});

Thanks to the work of Wes Mason for his better regular expressions.

Readme

Keywords

none

Package Sidebar

Install

npm i detect-line-endings

Weekly Downloads

1

Version

0.0.2

License

BSD

Last publish

Collaborators

  • johnkpaul