Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-to-txt

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-to-txt

Convert markdown to plain text

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

markdown-to-txt

Converts markdown to plain text. Uses marked to correctly parse and produce a clean version of the text. This correctly handles markdown elements like code blocks, unlike similar libraries. TypeScript declarations are provided out of the box.

Installation

To install

npm install markdown-to-txt

Usage

markdown-to-txt exports a single function for conversion. Call it like so

const { markdownToTxt } = require('markdown-to-txt');

markdownToTxt('Some *quoted* `*code*`'); // "Some quoted *code*"

Or in TypeScript/ES modules

import markdownToTxt from 'markdown-to-txt';

markdownToTxt('Some *quoted* `*code*`'); // "Some quoted *code*"

markdownToTxt accepts MarkedOptions as its second argument.

NOTE: The output of markdownToTxt is not sanitized. The output may contain valid HTML, JavaScript, etc. Be sure to sanitize if the output is intended for web use.

Changelog

  • 2.0.0
    • Options argument for markdownToTxt changed to align with latest version of marked.
    • escapeHtml option removed

Contact

Feel free to send be bug reports or feature requests. If you are interested in my other work, checkout my website.

Email root@ejrbuss.net

Keywords

FAQs

Package last updated on 22 Apr 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc