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

markdown2html-pro

v1.0.6

Published

A parser of Markdown and a render to html

Downloads

748

Readme

markdown2html-pro

GitHub Status

Build Status Coverage Status MIT license

NPM Status

Build Status Code Climate Dependency Status Issue Stats Issue Stats Conventional Commits

A parser of Markdown and a render to html, written in typescript, that aims for preview-code , which is published as an extension on Visual Studio Code to preview Markdown, ReStructured Text, HTML, Jade, Pug or Mermaid files, Image's URI or CSS while editing them in VSCode.

It is built on top of markdown-it, a CommonMark markdown parser. You can use markdown2html-pro:

markdown2html-pro is the thing that parses package READMEs on http://www.npmjs.com. If you see a markdown parsing bug there, file an issue here!

[programmatically in NodeJS]: #Using this module in other modules

README

An extension to preview Markdown, ReStructured Text, HTML, Jade, Pug or Mermaid files, Image's URI or CSS while editing them in VSCode

Installation

npm install markdown2html-pro --save

Using this module in other modules

Here is a quick example of how this module can be used in other modules. The TypeScript Module Resolution Logic makes it quite easy. The file src/index.ts is a barrel that re-exports selected exports from other files. The package.json file contains main attribute that points to the generated lib/index.js file and typings attribute that points to the generated lib/index.d.ts file.

If you are planning to have code in multiple files (which is quite natural for a NodeJS module) that users can import, make sure you update src/index.ts file appropriately.

Now assuming you have published this amazing module to npm with the name markdown2html-pro, and installed it in the module in which you need it -

  • To use the Markdown2HtmlPro class in a TypeScript file -
import { Markdown2HtmlPro } from "markdown2html-pro";
const markdownContent = "";
const markdown2htmlPro = new Markdown2HtmlPro();
markdown2htmlPro.markdown2html(markdownContent);
  • To use the Markdown2HtmlPro class in a JavaScript file -
const Markdown2HtmlPro = require('markdown2html-pro').Markdown2HtmlPro;
const markdownContent = "";

const markdown2htmlPro = new Markdown2HtmlPro();
markdown2htmlPro.markdown2html(markdownContent);

Setting travis and coveralls badges

  1. Sign in to travis and activate the build for your project.
  2. Sign in to coveralls and activate the build for your project.
  3. Replace searKing/markdown2html-pro with your repo details like: "ospatil/generator-node-typescript".

Programmatic Usage

markdown2html-pro exports a single function. For basic use, that function takes a single argument: a string to convert.

var marky = require("markdown2html-pro")
var html = marky("# hello, I'm markdown")

Tests

npm install
npm test

Thanks to