<commit_before># retext-inspect [![Build Status](https://img.shields.io/travis/wooorm/retext-inspect.svg?style=flat)](https://travis-ci.org/wooorm/retext-inspect) [![Coverage Status](https://img.shields.io/coveralls/wooorm/retext-inspect.svg?style=flat)](https://coveralls.io/r/wooorm/retext-inspect?branch=master)

**[retext](https://github.com/wooorm/retext "Retext")** node inspector.

## Installation

npm:

```bash
$ npm install retext-inspect
```

Component:

```bash
$ component install wooorm/retext-inspect
```

Bower:

```bash
$ bower install retext-inspect
```

## Usage

```javascript
var Retext = require('retext');
var inspect = require('retext-inspect');

var retext = new Retext().use(inspect);

retext.parse('Some simple text.', function (err, tree) {
    /* Inspect a node: */
    console.log(tree.head.head.tail.inspect());
    /**
     * Logs:
     *
     * PunctuationNode[1]
     * └─ TextNode: '.'
     */

    /* Inspect a node in Node.js: */
    console.log(tree);
    /**
     * Logs:
     *
     * RootNode[1]
     * └─ ParagraphNode[1]
     *    └─ SentenceNode[6]
     *       ├─ WordNode[1]
     *       │  └─ TextNode: 'Some'
     *       ├─ WhiteSpaceNode[1]
     *       │  └─ TextNode: ' '<commit_msg>Refactor code examples in `Readme.md`<commit_after># retext-inspect [![Build Status](https://img.shields.io/travis/wooorm/retext-inspect.svg?style=flat)](https://travis-ci.org/wooorm/retext-inspect) [![Coverage Status](https://img.shields.io/coveralls/wooorm/retext-inspect.svg?style=flat)](https://coveralls.io/r/wooorm/retext-inspect?branch=master)

**[retext](https://github.com/wooorm/retext "Retext")** node inspector.

## Installation

npm:

```bash
$ npm install retext-inspect
```

Component:

```bash
$ component install wooorm/retext-inspect
```

Bower:

```bash
$ bower install retext-inspect
```

## Usage

```javascript
var Retext = require('retext');
var inspect = require('retext-inspect');

var retext = new Retext().use(inspect);

retext.parse('Some simple text.', function (err, tree) {
    /* Inspect a node: */
    console.log(tree.head.head.tail.inspect());
    /*
     * Logs:
     *
     * PunctuationNode[1]
     * └─ TextNode: '.'
     */

    /* Inspect a node in Node.js: */
    console.log(tree);
    /*
     * Logs:
     *
     * RootNode[1]
     * └─ ParagraphNode[1]
     *    └─ SentenceNode[6]
     *       ├─ WordNode[1]
     *       │  └─ TextNode: 'Some'
     *       ├─ WhiteSpaceNode[1]
     *       │  └─ TextNode: ' '
{'fraction_non_alphanumeric': 0.18739967897271267, 'fraction_numerical': 0.004815409309791332, 'mean_word_length': 3.020967741935484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '37770', 'n_tokens_mistral': 968, 'n_tokens_neox': 943, 'n_words': 154}