Skip to content

kolodny/crlf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crlf

NPM version Build status Test coverage Downloads

Detect and change line endings

Usage

The cli is probably the one you're looking for, first npm install -g crlf. Usage is something like this:

$ crlf index.js
index.js CRLF
$ crlf *.js
index.js CRLF
test.js LF
$ crlf --set=LF *.js
index.js CRLF -> LF
test.js LF -> LF
$ crlf index.js
LF

Here's the API usage

var crlf = require('crlf');

crlf.get(__dirname + '/package.json', null, function(err, endingType) {
  console.log(endingType); // LF
});
crlf.set(__dirname + '/package.json', 'CRLF', function(err, endingType) {
  console.log(endingType); // LF
  // file was using LF and now uses CRLF
});

About

get and set line endings - Pull Requests welcome

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published