8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ ** nlcst** ] [ nlcst ] utility to serialize a node.
11
+ [ nlcst] [ ] utility to serialize a node.
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
+ * [ ` toString(node[, separator]) ` ] ( #tostringnode-separator )
21
+ * [ Types] ( #types )
22
+ * [ Compatibility] ( #compatibility )
23
+ * [ Contribute] ( #contribute )
24
+ * [ License] ( #license )
25
+
26
+ ## What is this?
14
27
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 .
28
+ This package is a utility that takes [ nlcst ] [ ] nodes and gets their plain-text
29
+ value .
17
30
18
- [ npm] [ ] :
31
+ ## When should I use this?
32
+
33
+ This is a small utility that is useful when you’re dealing with ASTs.
34
+
35
+ ## Install
36
+
37
+ This package is [ ESM only] [ esm ] .
38
+ In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install with [ npm] [ ] :
19
39
20
40
``` sh
21
- npm install nlcst-to-string
41
+ npm install nlcst-util-to-string
42
+ ```
43
+
44
+ In Deno with [ ` esm.sh ` ] [ esmsh ] :
45
+
46
+ ``` js
47
+ import {toString } from " https://esm.sh/nlcst-util-to-string@3"
48
+ ```
49
+
50
+ In browsers with [ ` esm.sh ` ] [ esmsh ] :
51
+
52
+ ``` html
53
+ <script type =" module" >
54
+ import {toString } from " https://esm.sh/nlcst-util-to-string@3?bundle"
55
+ </script >
22
56
```
23
57
24
58
## Use
@@ -40,7 +74,7 @@ console.log(
40
74
41
75
## API
42
76
43
- This package exports the following identifiers: ` toString ` .
77
+ This package exports the identifier ` toString ` .
44
78
There is no default export.
45
79
46
80
### ` toString(node[, separator]) `
@@ -49,17 +83,29 @@ Stringify the given [nlcst][] node (or list of nodes).
49
83
50
84
###### Parameters
51
85
52
- * ` node ` ([ ` Node ` ] [ node ] or ` Array<Node> ` )
53
- * ` separator ` (` string ` , default: ` '' ` ) — Value to delimit each item
86
+ * ` node ` ([ ` Node ` ] [ node ] or ` Array<Node> ` ) — node to serialize.
87
+ * ` separator ` (` string ` , default: ` '' ` ) — value to delimit each item
54
88
55
89
###### Returns
56
90
57
91
` string ` .
58
92
93
+ ## Types
94
+
95
+ This package is fully typed with [ TypeScript] [ ] .
96
+ It exports no additional types.
97
+
98
+ ## Compatibility
99
+
100
+ Projects maintained by the unified collective are compatible with all maintained
101
+ versions of Node.js.
102
+ As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
103
+ Our projects sometimes work with older versions, but this is not guaranteed.
104
+
59
105
## Contribute
60
106
61
- See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
62
- started.
107
+ See [ ` contributing.md ` ] [ contributing ] in [ ` syntax-tree/.github ` ] [ health ] for
108
+ ways to get started.
63
109
See [ ` support.md ` ] [ support ] for ways to get help.
64
110
65
111
This project has a [ code of conduct] [ coc ] .
@@ -100,15 +146,23 @@ abide by its terms.
100
146
101
147
[ npm ] : https://docs.npmjs.com/cli/install
102
148
149
+ [ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
150
+
151
+ [ esmsh ] : https://esm.sh
152
+
153
+ [ typescript ] : https://www.typescriptlang.org
154
+
103
155
[ license ] : license
104
156
105
157
[ author ] : https://wooorm.com
106
158
107
- [ contributing ] : https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
159
+ [ health ] : https://github.com/syntax-tree/.github
160
+
161
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/main/contributing.md
108
162
109
- [ support ] : https://github.com/syntax-tree/.github/blob/HEAD /support.md
163
+ [ support ] : https://github.com/syntax-tree/.github/blob/main /support.md
110
164
111
- [ coc ] : https://github.com/syntax-tree/.github/blob/HEAD /code-of-conduct.md
165
+ [ coc ] : https://github.com/syntax-tree/.github/blob/main /code-of-conduct.md
112
166
113
167
[ nlcst ] : https://github.com/syntax-tree/nlcst
114
168
0 commit comments