@nsis/dent 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,51 @@
|
|
|
10
10
|
|
|
11
11
|
`npm install @nsis/dent`
|
|
12
12
|
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Dent } from '@nsis/dent';
|
|
17
|
+
|
|
18
|
+
const dent = new Dent(/* user options */);
|
|
19
|
+
|
|
20
|
+
dent.format(`
|
|
21
|
+
# Look ma, no indentation
|
|
22
|
+
Name "Demo"
|
|
23
|
+
Section
|
|
24
|
+
Nop
|
|
25
|
+
Section
|
|
26
|
+
`);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Options
|
|
30
|
+
|
|
31
|
+
#### `options.endOfLines`
|
|
32
|
+
|
|
33
|
+
Type: `"crlf" | "lf"`
|
|
34
|
+
Default: `"crlf"` (Windows), `"lf"` (Linux, macOS)
|
|
35
|
+
|
|
36
|
+
#### `options.indentSize`
|
|
37
|
+
|
|
38
|
+
Type: `number`
|
|
39
|
+
Default: `2`
|
|
40
|
+
|
|
41
|
+
#### `options.trimEmptyLines`
|
|
42
|
+
|
|
43
|
+
Type: `boolean`
|
|
44
|
+
Default: `true`
|
|
45
|
+
|
|
46
|
+
#### `options.useTabs`
|
|
47
|
+
|
|
48
|
+
Type: `boolean`
|
|
49
|
+
Default: `true`
|
|
50
|
+
|
|
51
|
+
:white_check_mark: [Why defaulting to tabs is good for accessibility](https://github.com/prettier/prettier/issues/7475#issuecomment-668544890)
|
|
52
|
+
|
|
53
|
+
## Related
|
|
54
|
+
|
|
55
|
+
- [CLI for `dent`](https://www.npmjs.com/package/@nsis/dent-cli)
|
|
56
|
+
|
|
13
57
|
## License
|
|
14
58
|
|
|
15
59
|
This work is licensed under [The MIT License](LICENSE)
|
|
16
|
-
|
|
60
|
+
|