1 | # is-fs-case-sensitive [![Latest version](https://badgen.net/npm/v/is-fs-case-sensitive)](https://npm.im/is-fs-case-sensitive) [![Install size](https://packagephobia.now.sh/badge?p=is-fs-case-sensitive)](https://packagephobia.now.sh/result?p=is-fs-case-sensitive)
|
2 |
|
3 | Detect whether the file-system has case-sensitive file paths.
|
4 |
|
5 | ## 🙋♂️ Why?
|
6 | File systems can have case-sensitive or case-insensitive file paths:
|
7 |
|
8 | - [macOS is case-insensitive by default](https://support.apple.com/guide/disk-utility/file-system-formats-dsku19ed921c/mac#dsku127e6e61)
|
9 | - [Windows is case-insensitive by default](https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity)
|
10 | - [Linux is case-sensitive](https://stackoverflow.com/a/26300931/911407)
|
11 |
|
12 | This distinction is important for tools that navigate the file-system (e.g. whether to apply a glob case-sensitively).
|
13 |
|
14 | ## 🚀 Install
|
15 | ```sh
|
16 | npm install is-fs-case-sensitive
|
17 | ```
|
18 |
|
19 | ## 👨🏻🏫 Examples
|
20 |
|
21 | ```ts
|
22 | import { isFsCaseSensitive } from 'is-fs-case-sensitive'
|
23 |
|
24 | console.log(isFsCaseSensitive())
|
25 | // => false
|
26 | ```
|
27 |
|
28 | ## ⚙️ API
|
29 |
|
30 | ### isFsCaseSensitive(fs)
|
31 |
|
32 | Returns: `boolean`
|
33 |
|
34 | #### fs
|
35 | Type: `typeof fs`
|
36 |
|
37 | Default: `import('fs')`
|
38 |
|
39 | The file-system to use to check for case-sensitivity.
|