make your crlf to lf
npm install lfifyA lightweight Node.js program to convert CRLF to LF line endings.
It is useful when your development environment is Windows.
``bash`
npx lfify --include "/*.js" --exclude "node_modules/"
Create .lfifyrc.json:
`json`
{
"entry": "./",
"include": [
"*/.{js,ts,jsx,tsx}",
"*/.{json,md}",
"*/.{css,scss}",
"*/.{html,vue}"
],
"exclude": [
"node_modules/**",
".git/**",
"dist/**",
"build/**",
"coverage/**"
]
}
Then run:
`bash`
npx lfify
| Option | Description |
| -------------------- | --------------------------------------------------------------------------- |
| --config | Specify a custom path for the configuration file. Default is .lfifyrc.json. |--entry
| | Specify the entry directory to process. Default is ./. |--include
| | Glob pattern(s) to include. Can be used multiple times. |--exclude
| | Glob pattern(s) to exclude. Can be used multiple times. |
`bashProcess all JavaScript files, exclude node_modules
npx lfify --include "/*.js" --exclude "node_modules/"
Default 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/**Priority
CLI options take precedence over config file values:
1. CLI arguments (highest)
2. Config file
3. Default values (lowest)
Development
Prerequisites
- Node.js 18 or higher
- npm
Setup
Clone the repository:
`bash
git clone https://github.com/GyeongHoKim/lfify.git
`Install dependencies:
`bash
npm install
`Testing
`bash
npm test
`Linting
`bash
npm run lint
`Contributing
1. Fork the repository
2. Create a new branch
3. Make your changes
4. Run
npm run lint to check your code
5. Run npm test` to check your codeIf you have any issues or feedback, please open an issue on the GitHub repository.