retext-inspect
retext node inspector.
Installation
npm:
$ npm install retext-inspect
$ component install wooorm/retext-inspect
$ bower install retext-inspect
Duo:
var inspect = ;
Usage
var Retext = ;var inspect = ; var retext = ; retext;
API
Retext#use(inspect, options?)
retext = ;
Options:
color
(boolean
, defaulttrue
) - The diagram returned byinspect
uses color to make things more awesome. Support is detected by checking if autil.inspect()
exists (it does in Node.js). To overwrite this, pass anoptions
object as a second argument toRetext#use()
, with acolor
property set tofalse
.
Node#inspect()
Get a string representing node
.
There’s no need to call Node#inspect()
when in Node.js. In Node.js, console.log
and util.inspect
all show the tree diagram as seen above.
To log the nodes as normal objects, pass customInspect: false
to util.inspect()
:
console
Performance
TextOM.Node#inspect() 1,062 op/s » A paragraph (5 sentences, 100 words) 101 op/s » A section (10 paragraphs, 50 sentences, 1,000 words) 9 op/s » An article (100 paragraphs, 500 sentences, 10,000 words)