lfify
v1.2.2
Published
make your crlf to lf
Readme
LFify
A lightweight Node.js program to convert CRLF to LF line endings.
It is useful when your development environment is Windows.
Getting started
Using CLI options (no config file needed)
npx lfify --include "**/*.js" --exclude "node_modules/**"Using config file
Create .lfifyrc.json:
{
"entry": "./",
"include": [
"**/*.{js,ts,jsx,tsx}",
"**/*.{json,md}",
"**/*.{css,scss}",
"**/*.{html,vue}"
],
"exclude": [
"node_modules/**",
".git/**",
"dist/**",
"build/**",
"coverage/**"
],
"logLevel": "error"
}Then run:
npx lfifyOptions
| Option | Description |
| --------------------- | ----------------------------------------------------------------------------- |
| --config <path> | Specify a custom path for the configuration file. Default is .lfifyrc.json. |
| --entry <path> | Specify the entry directory to process. Default is ./. |
| --include <pattern> | Glob pattern(s) to include. Can be used multiple times. |
| --exclude <pattern> | Glob pattern(s) to exclude. Can be used multiple times. |
| --log-level <level> | Set log level: error, warn, or info. Default is error. |
Examples
# Process all JavaScript files, exclude node_modules
npx lfify --include "**/*.js" --exclude "node_modules/**"
# Process multiple file types
npx lfify --include "**/*.js" --include "**/*.ts" --exclude "node_modules/**" --exclude ".git/**"
# Process files in a specific directory
npx lfify --entry ./src --include "**/*.js"
# Use a custom config file
npx lfify --config ./custom-config.json
# Show detailed progress logs
npx lfify --log-level > warnDefault behavior
When no config file is found and no CLI options are provided, lfify uses sensible defaults:
- include:
**/*(all files) - exclude:
node_modules/**,.git/**,dist/**,build/**,coverage/** - logLevel:
error
Priority
CLI options take precedence over config file values:
- CLI arguments (highest)
- Config file
- Default values (lowest)
Development
Prerequisites
- Node.js 18 or higher
- npm
Setup
Clone the repository:
git clone https://github.com/GyeongHoKim/lfify.gitInstall dependencies:
npm installTesting
npm testLinting
npm run lintContributing
- Fork the repository
- Create a new branch
- Make your changes
- Run
npm run lintto check your code - Run
npm testto check your code - Submit a pull request
Issues and Support
If you have any issues or feedback, please open an issue on the GitHub repository.
