$ gnpm install hast-util-to-string
Get the plain-text value of a hast node.
This package is ESM only:
Node 12+ is needed to use it and it must be imported
ed instead of required
d.
npm:
npm install hast-util-to-string
This package exports the following identifiers:
toString
.
There is no default export.
import {h} from 'hastscript'
import {toString} from 'hast-util-to-string'
toString(h('p', 'Alpha'))
//=> 'Alpha'
toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
//=> 'Bold and italic.'
toString(node)
Transform a node to a string.
See contributing.md
in rehypejs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
Copyright 2013 - present © cnpmjs.org | Home |