eol-converter-cli

Newline converter CLI for simple CRLF -> LF (and reverse) convertions of multiple files.

Apache 2.0 14 个版本
安装
npm install eol-converter-cli
yarn add eol-converter-cli
pnpm add eol-converter-cli
bun add eol-converter-cli
README

Newlines (EOL) converter CLI

Having troubles with different line endings? :flushed:

This library will simply convert files of your choice to Windows (CRLF), or popular LF line ends used on Linux and Mac.

Installation:

npm i -g eol-converter-cli

API: eolConverter OptionalModifier "glob_files_regex"

  • OptionalModifier can be empty, warmup, or crlf - see examples.
  • For files paths resolution is used GLOB regex

Examples

Run just warmup - to see which files will be affected:

eolConverter warmup "**/*.js"

Run conversions (cannot be undone):

To LF (Unix & Mac default)

eolConverter "**/*.js"
eolConverter "**/*.{js,jsx,ts,tsx}"
eolConverter "src/**/*.js"
eolConverter "{src,tests}/**/*.js"

To CRLF (Windows default)

eolConverter crlf "**/*.js"

Tips

PS: Don't forget to configure you favourite IDE to work with desired line endings, so that you won't need this tool again! :smirk:

Please give project :star: if you like it!

License

Apache 2.0 © Juraj Husár

版本列表
1.1.0 2024-07-31
1.0.8 2018-04-05
1.0.7 2017-06-28
1.0.6 2017-06-28
1.0.5 2017-06-28
1.0.4 2017-06-28
1.0.3 2017-06-28
1.0.2 2017-06-28
1.0.1 2017-06-28
1.0.0 2017-06-28
0.0.4 2017-06-28
0.0.3 2017-06-28
0.0.2 2017-06-28
0.0.1 2017-06-28