10
10
npm install unist-util-inspect
11
11
```
12
12
13
- ** unist-util-inspect** is also available as an AMD, CommonJS, and
14
- globals module, [ uncompressed and compressed] [ releases ] .
15
-
16
13
## Usage
17
14
18
15
``` javascript
19
16
var retext = require (' retext' );
20
17
var inspect = require (' unist-util-inspect' );
21
18
22
- retext ().use (function () {
23
- return function (cst ) {
24
- console .log (inspect (cst));
25
- }
26
- }).process (' Some simple text.' );
19
+ retext ().use (plugin).process (' Some simple text.' );
20
+
21
+ function plugin () {
22
+ return transformer;
23
+ function transformer (tree ) {
24
+ console .log (inspect (tree));
25
+ }
26
+ }
27
27
```
28
28
29
29
Yields:
@@ -50,11 +50,13 @@ RootNode[1] (1:1-1:18, 0-17)
50
50
By default, color support is enabled on Node.js and turned off anywhere else.
51
51
See below on how to change that.
52
52
53
- ** Parameters**
53
+ ###### Parameters
54
54
55
55
* ` node ` ([ ` Node ` ] [ node ] ).
56
56
57
- ** Returns** ` string ` — String representing ` node ` .
57
+ ###### Returns
58
+
59
+ ` string ` — String representing ` node ` .
58
60
59
61
### ` inspect.<style>[.<style>...](node) `
60
62
@@ -81,8 +83,6 @@ or `inspect.noColor(node)`.
81
83
82
84
[ npm ] : https://docs.npmjs.com/cli/install
83
85
84
- [ releases ] : https://github.com/wooorm/unist-util-inspect/releases
85
-
86
86
[ node ] : https://github.com/wooorm/unist#unist-nodes
87
87
88
88
[ license ] : LICENSE
0 commit comments