npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

markdownconvert

v1.3.3

Published

Markdown Converter (markdownconvert) is a conversion tool to convert Markdown into HTML.

Downloads

53

Readme

Markdown Convert

Markdown convert is a conversion tool used to, you guessed it, convert markdown to HTML.

  • 🐈 Markdown to HTML parser
  • ⚡Built differently, for performance
  • ⚖️ light-weight while also having custom markdown conversions built-in
  • 🔥 Support for HTTP request blocks to be rendered with custom Markdown
  • 🪴 Remove markdown syntax and get the text content - all without the asterisks and underscores

Installation

Get started by running the install command 😊

npm install markdownconvert

Usage

Currently, you can use markdownconvert in the following ways.

Node.js

const mdconvert = require('markdownconvert');

let string = "This is some **cool** Markdown to **HTML**, generated by `markdownconvert` for ~~me~~ you.";

let converted = mdconvert.convert(string);
/* Output:
<p>This is some <strong>cool</strong> Markdown to <strong>HTML</strong>, generated by <code>markdownconvert</code> for <s>me</s> you.</p>
*/

Current Functions

convert(string, options) // Converts Markdown to HTML.
render(string, options) // Another function name, same as convert()

registerBlock({open: 'optional', close: 'optional', exec: function}) // Registers a block replacement that is executed, good for custom addons
registerInline({open: 'optional', close: 'optional', exec: function}) // Registers an in-line block replacement. Again, good for custom addons

getStyle(index, returnClassEquals) // Returns the registered style (class name) for the associated element, returnClassEquals will return the style as ' class="class_name"'.
updateStyle(index, newProperty) // Create or overwrite existing style for the defined element

Options

options.sanitize // Sanitizes the function, removing any HTML script tags.
options.plainText // Removes markdown formatting so the plain text is returned without formatting or syntax.

Both of these default to false.

Modifying Styles

Markdownconvert allows you to change the CSS properties of a tag to allow your own customisation. There's a list of Default Styles available.

To update a style you can use the updateStyle() function.

const mdconvert = require('markdownconvert');
mdconvert.updateStyle('contDanger', 'converterDangerCSS');

// To fetch this property you can use the `getStyle()` function
mdconvert.getStyle('contDanger');

If contDanger wasn't found in the list, it would be created and added, which is perfect for adding your own rules with registerBlock() or registerInline().

Change-log

Get all the latest changes at github.com/FAXES/markdownconvert/releases

Authors

Markdownconvert is created by Weblutions & FAXES.