0.0.2 • Published 10 years ago

detect-line-endings v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
10 years ago

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.