@inkdropapp/html2markdown
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

html2markdown

It converts HTML to Markdown using remark and rehype.

install

npm install @inkdropapp/html2markdown

How to use

Say we have the following markdown file, example.md:

<h1>Hello, world!</h1>

And our script, example.js, looks as follows:

import { html2Markdown } from '@inkdropapp/html2markdown'
import fs from 'fs'

const doc = fs.readFileSync('example.md')

const md = html2Markdown(doc)

console.log(md)

Now, running node example yields:

# Hello, world!

API

html2Markdown(html, options)

Converts the given HTML to Markdown.

Options

License

MIT © Takuya Matsuyama

Readme

Keywords

Package Sidebar

Install

npm i @inkdropapp/html2markdown

Weekly Downloads

89

Version

4.0.0

License

MIT

Unpacked Size

141 kB

Total Files

45

Last publish

Collaborators

  • craftzdog