UNPKG

1.23 kBMarkdownView Raw
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
3Detect whether the file-system has case-sensitive file paths.
4
5## 🙋‍♂️ Why?
6File 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
12This distinction is important for tools that navigate the file-system (e.g. whether to apply a glob case-sensitively).
13
14## 🚀 Install
15```sh
16npm install is-fs-case-sensitive
17```
18
19## 👨🏻‍🏫 Examples
20
21```ts
22import { isFsCaseSensitive } from 'is-fs-case-sensitive'
23
24console.log(isFsCaseSensitive())
25// => false
26```
27
28## ⚙️ API
29
30### isFsCaseSensitive(fs)
31
32Returns: `boolean`
33
34#### fs
35Type: `typeof fs`
36
37Default: `import('fs')`
38
39The file-system to use to check for case-sensitivity.