New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

markdown-htmlify

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-htmlify

A versatile Node.js package for converting Markdown to HTML. Fetch Markdown content from a URL, local file, or text string, and render it into HTML.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
0
Created
Source

Markdown Renderer

A versatile Node.js package for converting Markdown to HTML. Fetch Markdown content from a URL, local file, or text string, and render it into HTML.

Features

  • Fetch Markdown from various sources: URL, local path, or text.
  • Convert Markdown to HTML using a custom renderer.
  • Lightweight and dependency-free.

Installation

To install the package, run:

npm install markdown-htmlify

Usage

Importing the Package

You can import the package in your TypeScript or JavaScript file as follows:

import { renderMarkdown } from 'markdown-htmlify';

Rendering Markdown

You can render Markdown from a URL, local path, or text string:

// change https://example.com/readme.md to your own markdown path
const markdownFromUrl = await renderMarkdown('https://example.com/readme.md');
const markdownFromFile = await renderMarkdown('/path/to/local/file.md');
const markdownFromText = await renderMarkdown('# Hello World\nThis is a markdown text.');

Example

Here’s a simple example of how to use the package:

import { renderMarkdown } from 'markdown-htmlify';

async function main() {
    const html = await renderMarkdown('https://example.com/readme.md');
    console.log(html);
}

main();

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

markdown

FAQs

Package last updated on 24 Jan 2025

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