JSPM

@wcj/html-to-markdown

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6543
  • Score
    100M100P100Q136866F
  • License MIT

html conversion tool to markdown.

Package Exports

  • @wcj/html-to-markdown

Readme

@wcj/html-to-markdown

HTML conversion tool to markdown. command line tool => @wcj/html-to-markdown-cli.

Installation

This package is ESM only: Node 14+ is needed to use it and it must be import instead of require.

npm i @wcj/html-to-markdown

Command line tool

$ npx @wcj/html-to-markdown-cli ./html/index.html
# => # Markdown String
$ npx @wcj/html-to-markdown-cli https://jaywcjlove.github.io/idoc/
# => # Markdown String

# Or

$ sudo npm i @wcj/html-to-markdown-cli -g
$ html-to-markdown ./html/index.html
# => # Markdown String
$ html-to-markdown https://jaywcjlove.github.io/idoc/
# => # Markdown String

Usage

import htmlToMarkdown from '@wcj/html-to-markdown';

htmlToMarkdown({ html: '<h1>Markdown String</h1>' });
// => # Markdown String

API

import { Options as RehypeParseOptions } from 'rehype-parse';
declare type Options = {
  html?: string;
  url?: string;
  rehypeParseOption?: RehypeParseOptions;
};
export default function htmlToMarkdown(options?: Options): Promise<string>;

Development

$ npm i
$ npm install --workspaces
$ npm run build

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

Licensed under the MIT License.