8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ ** nlcst** ] [ nlcst ] utility to normalize a word for easier comparison.
11
+ [ nlcst] [ ] utility to normalize a word for easier comparison.
12
12
13
- ## Install
13
+ ## Contents
14
+
15
+ * [ What is this?] ( #what-is-this )
16
+ * [ When should I use this?] ( #when-should-i-use-this )
17
+ * [ Install] ( #install )
18
+ * [ Use] ( #use )
19
+ * [ API] ( #api )
20
+ * [ ` normalize(value[, options]) ` ] ( #normalizevalue-options )
21
+ * [ Types] ( #types )
22
+ * [ Compatibility] ( #compatibility )
23
+ * [ Related] ( #related )
24
+ * [ Contribute] ( #contribute )
25
+ * [ License] ( #license )
26
+
27
+ ## What is this?
28
+
29
+ This utility serializes a node and cleans it.
30
+
31
+ ## When should I use this?
32
+
33
+ This package is a tiny utility that helps when comparing natural language to
34
+ word lists.
14
35
15
- This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
16
- Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
36
+ ## Install
17
37
18
- [ npm] [ ] :
38
+ This package is [ ESM only] [ esm ] .
39
+ In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install with [ npm] [ ] :
19
40
20
41
``` sh
21
42
npm install nlcst-normalize
22
43
```
23
44
45
+ In Deno with [ ` esm.sh ` ] [ esmsh ] :
46
+
47
+ ``` js
48
+ import {normalize } from " https://esm.sh/nlcst-normalize@3"
49
+ ```
50
+
51
+ In browsers with [ ` esm.sh ` ] [ esmsh ] :
52
+
53
+ ``` html
54
+ <script type =" module" >
55
+ import {normalize } from " https://esm.sh/nlcst-normalize@3?bundle"
56
+ </script >
57
+ ```
58
+
24
59
## Use
25
60
26
61
``` js
@@ -44,7 +79,7 @@ normalize({
44
79
45
80
## API
46
81
47
- This package exports the following identifiers: ` normalize ` .
82
+ This package exports the identifier ` normalize ` .
48
83
There is no default export.
49
84
50
85
### ` normalize(value[, options]) `
@@ -54,25 +89,41 @@ comparison.
54
89
Always normalizes smart apostrophes (` ’ ` ) to straight apostrophes (` ' ` ) and
55
90
lowercases alphabetical characters (` [A-Z] ` ).
56
91
92
+ ##### ` options `
93
+
94
+ Configuration (optional).
95
+
57
96
###### ` options.allowApostrophes `
58
97
59
- ` boolean ` , default: ` false ` — Do not strip apostrophes (` ' ` ).
98
+ Do not strip apostrophes (` ' ` ) ( ` boolean ` , default: ` false ` ).
60
99
61
100
###### ` options.allowDashes `
62
101
63
- ` boolean ` , default: ` false ` — Do not strip hyphens (` - ` ).
102
+ Do not strip hyphens (` - ` ) (` boolean ` , default: ` false ` ).
103
+
104
+ ## Types
105
+
106
+ This package is fully typed with [ TypeScript] [ ] .
107
+ It exports the additional types ` Options ` .
108
+
109
+ ## Compatibility
110
+
111
+ Projects maintained by the unified collective are compatible with all maintained
112
+ versions of Node.js.
113
+ As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
114
+ Our projects sometimes work with older versions, but this is not guaranteed.
64
115
65
116
## Related
66
117
67
118
* [ ` nlcst-is-literal ` ] ( https://github.com/syntax-tree/nlcst-is-literal )
68
- — Check whether a node is meant literally
119
+ — check whether a node is meant literally
69
120
* [ ` nlcst-search ` ] ( https://github.com/syntax-tree/nlcst-search )
70
- — Search for patterns
121
+ — search for patterns
71
122
72
123
## Contribute
73
124
74
- See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
75
- started.
125
+ See [ ` contributing.md ` ] [ contributing ] in [ ` syntax-tree/.github ` ] [ health ] for
126
+ ways to get started.
76
127
See [ ` support.md ` ] [ support ] for ways to get help.
77
128
78
129
This project has a [ code of conduct] [ coc ] .
@@ -113,15 +164,23 @@ abide by its terms.
113
164
114
165
[ npm ] : https://docs.npmjs.com/cli/install
115
166
167
+ [ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
168
+
169
+ [ esmsh ] : https://esm.sh
170
+
171
+ [ typescript ] : https://www.typescriptlang.org
172
+
116
173
[ license ] : license
117
174
118
175
[ author ] : https://wooorm.com
119
176
120
- [ contributing ] : https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
177
+ [ health ] : https://github.com/syntax-tree/.github
178
+
179
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/main/contributing.md
121
180
122
- [ support ] : https://github.com/syntax-tree/.github/blob/HEAD /support.md
181
+ [ support ] : https://github.com/syntax-tree/.github/blob/main /support.md
123
182
124
- [ coc ] : https://github.com/syntax-tree/.github/blob/HEAD /code-of-conduct.md
183
+ [ coc ] : https://github.com/syntax-tree/.github/blob/main /code-of-conduct.md
125
184
126
185
[ nlcst ] : https://github.com/syntax-tree/nlcst
127
186
0 commit comments