hast-util-to-string
Get the plain-text value of a node
Last updated 7 years ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install hast-util-to-string 
SYNC missed versions from official npm registry.

hast-util-to-string

Build Coverage Downloads Size Sponsors Backers Chat

Get the plain-text value of a hast node.

Install

This package is ESM only: Node 12+ is needed to use it and it must be importeded instead of requiredd.

npm:

npm install hast-util-to-string

This package exports the following identifiers: toString. There is no default export.

Use

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.'

API

toString(node)

Transform a node to a string.

Contribute

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.

License

MIT © Titus Wormer

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

6 Versions

  • 2.0.0                                ...           3 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |