1. crlf
detect and change newline endings
crlf
Package: crlf
Created by: kolodny
Last modified: Tue, 14 Jun 2022 03:30:53 GMT
Version: 1.1.1
License: MIT
Downloads: 53,291
Repository: https://github.com/kolodny/crlf

Install

npm install crlf
yarn add crlf

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
});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code