Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via pnpm

mdast-util-to-string 4.0.0

mdast utility to get the plain text content of a node
Package summary
Share
0
issues
1
license
3
MIT
Package created
2 Jul 2015
Version published
7 Jul 2023
Maintainers
2
Total deps
3
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
@types/mdast@4.0.4
@types/unist@3.0.2
mdast-util-to-string@4.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of mdast-util-to-string 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@types/mdast4.0.428.74 kBMIT
prod

Visualizations

Frequently Asked Questions

What does mdast-util-to-string do?

mdast-util-to-string is a fantastic tool that fetches the text content of a specific node. With assistance from this JavaScript utility, users can easily extract the plain text inside a node without having to go through the markdown serialization process.

How do you use mdast-util-to-string?

The usage of mdast-util-to-string is straightforward. This package does not come with a default export; it exports the identifier toString. Below is an example on how to use this utility:

import {fromMarkdown} from 'mdast-util-from-markdown'
import {toString} from 'mdast-util-to-string'

const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.')

console.log(toString(tree)) // => 'Some emphasis, importance, and code.'

From this code snippet, we can see it's a two-step process:

First, we import the utility functions fromMarkdown and toString. Then, the fromMarkdown function is used to parse a markdown string into a tree, and finally, the toString function outputs the text content of that markdown content, stripping all the markdown syntax.

Where are the mdast-util-to-string docs?

The full documentation for mdast-util-to-string is available directly at its GitHub page, https://github.com/syntax-tree/mdast-util-to-string. This package is part of the unified collective and majorly supports Node.js versions. The documentation provides ample insights about installation, usage, options available, compatibility, security, related packages, contribution, and license involved in the use of this package.