Skip to content

Commit

Permalink
Refactor prose
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Feb 10, 2020
1 parent ada0dc5 commit 137c23f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "unist-util-parents",
"version": "1.0.2",
"description": "Add a parent reference for each AST node",
"description": "utility to add references to parents on nodes in a tree",
"license": "MIT",
"keywords": [
"unist",
"remark",
"rehype",
"retext",
"unist-util",
"util",
"utility",
"parent",
"parents",
"node",
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ which it originated.

[npm][]:

```bash
```sh
npm install unist-util-parents
```

## Usage
## Use

```javascript
```js
var u = require('unist-builder')
var parents = require('unist-util-parents')

Expand Down Expand Up @@ -61,7 +61,7 @@ console.log(chain)

Yields:

```javascript
```js
[ 'root', 'node', 'node', 'node', 'leaf' ]
```

Expand All @@ -76,7 +76,7 @@ all of its nodes:
* `node` — link to the original node

None of these properties are enumerable, and the original tree is *not changed*.
This means you can `JSON.stringify` the wrapped tree and it is just the same.
This means you can `JSON.stringify` the wrapped tree and it’s the same.

`wrapped.children` returns array of wrapped child nodes, so that any
recursive algorithm will work on a wrapped tree just as well.
Expand Down

0 comments on commit 137c23f

Please sign in to comment.