You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

mdast-util-to-string

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-to-string

mdast utility to get the plain text content of a node

4.0.0
latest
Source
npm
Version published
Weekly downloads
14M
-4.91%
Maintainers
2
Weekly downloads
 
Created

What is mdast-util-to-string?

The mdast-util-to-string package is a utility to extract plain text strings from an MDAST (Markdown Abstract Syntax Tree) node. It is commonly used when working with markdown processing or AST manipulation to get the string representation of a node without any markdown syntax.

What are mdast-util-to-string's main functionalities?

Extracting string from MDAST node

This feature allows you to pass an MDAST node to the `toString` function and receive a plain text string in return. It's useful for extracting readable text from markdown content.

const toString = require('mdast-util-to-string');
const mdast = {
  type: 'paragraph',
  children: [{type: 'text', value: 'Hello, world!'}]
};

const text = toString(mdast);
console.log(text); // 'Hello, world!'

Other packages similar to mdast-util-to-string

Keywords

unist

FAQs

Package last updated on 07 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts