# crlf-phobia

> Scared of CRLF

Latest version **1.2.0** (published 2023-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install crlf-phobia
pnpm add crlf-phobia
yarn add crlf-phobia
bun add crlf-phobia
```

Provides the command `crlf-phobia`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities; has provenance.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2023-05-18 |
| First published | 2022-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 5 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (Unknown) |
| GitHub stars | 0 |
| Author | Leomotors |
| Maintainers | leomotors |

## Links

- npm: https://www.npmjs.com/package/crlf-phobia
- Repository: https://github.com/Leomotors/CRLF-Phobia
- Homepage: https://github.com/Leomotors/CRLF-Phobia#readme
- Issues: https://github.com/Leomotors/CRLF-Phobia/issues
- npm.io page: https://npm.io/package/crlf-phobia

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^5.2.0
- [globby](https://npm.io/package/globby.md) ^13.1.4
- [ignore](https://npm.io/package/ignore.md) ^5.2.4
- [commander](https://npm.io/package/commander.md) ^10.0.1
- [istextorbinary](https://npm.io/package/istextorbinary.md) ^6.0.0

## Recent versions

- 1.2.0 (latest) — 2023-05-18
- 1.1.0 — 2023-05-18
- 1.0.1 — 2022-06-02
- 1.0.0 — 2022-06-02
- 0.2.0 — 2022-04-10
- 0.1.0 — 2022-04-10
- 0.1.0-experimental.1 — 2022-04-03

## README

# CRLF-Phobia

[![](https://img.shields.io/npm/v/crlf-phobia.svg?maxAge=3600)](https://www.npmjs.com/package/crlf-phobia)
 [![](https://img.shields.io/npm/dt/crlf-phobia.svg?maxAge=3600)](https://www.npmjs.com/package/crlf-phobia)

CRLF can cause disaster on your app sometimes.

Run this simple ~~inefficient~~ app to scan your project files and it will warn
you if there is a file with CRLF endings.

This app will ignore files ignored by .gitignore by default if exists, It also ignores binary files.
You can add or remove ignore files by using adding .crlfignore to the same level.

### Installation:

```bash
npm i -g crlf-phobia # Global
npm i -D crlf-phobia # To hook with unit test locally
```

### Usage:

```bash
crlf-phobia *.cpp # All CPP
crlf-phobia * .* # All Files exclude gitignored (for zsh, for PowerShell idk)
```

*Note*: CRLF-Phobia support both shell glob (Glob done by shell before parsing argv into program) and also shipped with glob ~~in case your shell is lazy.~~

### Q: Isn't there already an npm package that can do this?

### A: Yes

### Q: So how is yours different?

### A: Colors and MEMES

#### jk, this one is designed with "crlf-phobia" in mind. 

「駆逐してやる このプロジェックから、一匹残らず」

*I will wipe out every single CRLF from this project.*

## Limitation

- Awful performance: This library check for whole file to make sure **not**
a *single CRLF can survive!*

- Can only detect CRLF, because who use CR nowadays?

## Advanced Usage

Run before test:

```json
"test": "crlf-phobia * .* && pnpm real-test"
```

Run with GitHub Workflow

```yml
name: CRLF Phobia

on:
  push:

jobs:
  main:
    name: NO CRLF
    runs-on: ubuntu-latest

    steps:
      - name: actions/checkout
        uses: actions/checkout@v3

      # Do anything you want

      - name: Run CRLF-Phobia
        run: npx crlf-phobia * .*
```

---
_Source: https://npm.io/package/crlf-phobia · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
