Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 5, 2021
1 parent 38ce705 commit 31004cb
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ No change is needed: it works exactly the same now as it did before!

## Install

This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.

[npm][]:

```sh
Expand All @@ -36,15 +39,15 @@ npm install remark-vdom
Say we have the following file, `example.js`:

```js
var unified = require('unified')
var markdown = require('remark-parse')
var vdom = require('remark-vdom')
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkVdom from 'remark-vdom'

unified()
.use(markdown)
.use(vdom)
.process('Some _emphasis_, **importance**, and `code`.', function(err, file) {
if (err) throw err
.use(remarkParse)
.use(remarkVdom)
.process('Some _emphasis_, **importance**, and `code`.')
.then((file) => {
console.dir(file.result, {depth: null})
})
```
Expand Down Expand Up @@ -122,7 +125,10 @@ VirtualNode {

## API

### `remark().use(vdom[, options])`
This package exports no identifiers.
The default export is `remarkVdom`.

### `unified().use(remarkVdom[, options])`

Compile Markdown to [Virtual DOM][vdom].

Expand Down

0 comments on commit 31004cb

Please sign in to comment.