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 🙏

© 2026 – Pkg Stats / Ryan Hefner

markdown-wizard

v1.0.3

Published

A markdown wizard to generate Markdown documentations easily with JavaScript.

Readme

MarkdownWizard Documentation


Navigate to:

Installing

You can install MarkdownWizard either through npm or unpkg.

With NPM

npm install markdown-wizard

With UNPKG

<script src="https://www.unpkg.com/[email protected]/main.js"></script>

Usage when installed with UNPKG


<script>
  const wiz = new sk.MarkdownWizard()
  wiz.h1("Rest is up to you :)")
</script>

Creating an Instance

To get started with the MarkdownWizard, create a new instance:

const builder = new MarkdownWizard();

Description: Creates a new instance of the MarkdownWizard class.

Paragraphs

You can add paragraphs of text using the p(text) method:

builder.p("This is a paragraph of text.");

Description: Appends a paragraph of text to the Markdown content with the specified text.

Parameters:

|Parameter|Description| |:-|:-| |text|The text to add as a paragraph.|

Headings

You can add headings using the h1(header, underline, level), h2(header, underline, level), and h3(header) methods:

builder.h1("Heading 1");

Description: Appends a level 1 heading to the Markdown content with the specified header.

Parameters:

|Parameter|Description| |:-|:-| |header|The header text.| |underline (optional)|Whether to underline the header (default is false).| |level (optional)|The indentation level (default is 0).|

builder.h2("Heading 2");

Description: Appends a level 2 heading to the Markdown content with the specified header.

Parameters:

|Parameter|Description| |:-|:-| |header|The header text.| |underline (optional)|Whether to underline the header (default is false).| |level (optional)|The indentation level (default is 0).|

builder.h3("Heading 3");

Description: Appends a level 3 heading to the Markdown content with the specified header.

Parameters:

|Parameter|Description| |:-|:-| |header|The header text.|

Blockquotes

You can add blockquotes using the blockquote(text) method:

builder.blockquote("This is a blockquote.\nIt can have multiple lines.");

Don't love what you do, do what you love. - SK.

Description: Appends a blockquote to the Markdown content with the specified text.

Parameters:

|Parameter|Description| |:-|:-| |text|The blockquote text.|

Horizontal Rule

You can add a horizontal rule using the hr() method:

builder.hr();

Description: Appends a horizontal rule (hr) to the Markdown content.

Code Blocks

You can add code blocks using the codeBlock(code, lang) method:

builder.codeBlock("const x = 10;\nconsole.log(x);", "javascript");

Description: Appends a code block to the Markdown content with the specified code and optional lang (language) identifier.

Parameters:

|Parameter|Description| |:-|:-| |code|The code to be included in the code block.| |lang (optional)|The language identifier for syntax highlighting (default is an empty string).|

Tables

You can add tables using the table(columns, rows, alignments) method:

const columns = ["Header 1", "Header 2"];
const rows = [["Row 1 Cell 1", "Row 1 Cell 2"], ["Row 2 Cell 1", "Row 2 Cell 2"]];
const alignments = [Alignment.LEFT, Alignment.RIGHT];
builder.table(columns, rows, alignments);

Description: Appends a table to the Markdown content with specified columns, rows, and optional alignments for each column.

Parameters:

|Parameter|Description| |:-|:-| |columns|An array of column headers.| |rows|An array of arrays representing table rows.| |alignments (optional)|An array of text alignment options for columns. Alignments can be Alignment.LEFT, Alignment.CENTER, or Alignment.RIGHT.|

Line Breaks

You can add a line break using the br() method:

builder.br();

Description: Adds a line break to the Markdown content.

Inline Code

You can format text as inline code using the inlineCode(code) method:

const inlineCodeText = builder.inlineCode("console.log('Hello, World!');");

Description: Formats text as inline code by wrapping it in backticks (code).

Parameters:

|Parameter|Description| |:-|:-| |code|The text to be formatted as inline code.|

Inline Formatting

You can format text as italic or bold using the inlineItalic(string) and inlineBold(string) methods:

const italicText = builder.inlineItalic("This is italic text.");
const boldText = builder.inlineBold("This is bold text.");

Description: Formats text as italic or bold by enclosing it in asterisks (*) or double asterisks (**).

Parameters:

|Parameter|Description| |:-|:-| |string|The text to be formatted as italic or bold.|

Links

You can create links using the link(url, text, title) method:

const linkText = builder.link("https://example.com", "Visit Example", "Go to Example Website");

Description: Creates a hyperlink with the specified url, text, and optional title.

Parameters:

|Parameter|Description| |:-|:-| |url|The URL to link to.| |text|The link text.| |title (optional)|The optional link title.|

Images

You can insert images using the image(url, altText, title) method:

const imageTag = builder.image("https://example.com/image.jpg", "Alt Text", "Image Title");

Description: Inserts an image into the Markdown content with the specified url, altText, and optional title.

Parameters:

|Parameter|Description| |:-|:-| |url|The URL of the image.| |altText|The alternative text for the image.| |title (optional)|The optional image title.|

Getting the Markdown

To retrieve the generated Markdown content, use the getMarkdown() method:

const markdown = builder.getMarkdown();

Description: Returns the generated Markdown content as a string.

Line Indentation

You can control line indentation using the write(string, level) and writeln(string, level) methods. The level parameter determines the number of spaces to indent:

builder.writeln("Indented Text", 1);

Description: Appends a line of text followed by a line break. The level parameter controls the indentation level.

Parameters:

|Parameter|Description| |:-|:-| |string|The text to append.| |level (optional)|The indentation level (default is 0).|

Single Line

You can remove extra spaces and convert multiple lines into a single line using the singleLine(string) method:

const input = "  This   is\na\nmultiline\n    text.   ";
const singleLineText = builder.singleLine(input);

Description: Trims and removes extra spaces from a string to make it a single line.

Parameters:

|Parameter|Description| |:-|:-| |string|The input string.|

Bulleted Lists

You can create bulleted lists using the bulletedList(list, levels) method:

const list = ["Item 1", "Item 2", "Item 3"];
builder.bulletedList(list);

Description: Appends a bulleted list to the Markdown content from an array of items.

Parameters:

|Parameter|Description| |:-|:-| |list|An array of items to be listed in the bulleted list.| |levels (optional)|An optional array of indentation levels for each item.|

Ordered Lists

You can create ordered (numbered) lists using the orderedList(list) method:

const orderedListItems = ["First Item", "Second Item", "Third Item"];
builder.orderedList(orderedListItems);

Description: Appends an ordered (numbered) list to the Markdown content from an array of items.

Parameters:

|Parameter|Description| |:-|:-| |list|An array of items to be listed in the ordered list.|

Collapsible Sections

You can create collapsible sections using the collapsible(title, initiallyCollapsed, level) and endCollapsible() methods:

builder.collapsible("Click to Expand", true);

Description: Starts a collapsible section in the Markdown content with the specified title. You can choose to make it initially collapsed or expanded by setting initiallyCollapsed. The level parameter controls the indentation level.

Parameters:

|Parameter|Description| |:-|:-| |title|The title of the collapsible section.| |initiallyCollapsed (optional)|Whether the section is initially collapsed (default is false).| |level (optional)|The indentation level (default is 0).|

builder.endCollapsible();

Description: Ends the current collapsible section in the Markdown content.

Badge

You can add badges to your Markdown content using the badge(type, ...params) method:

builder.badge("BuyMeACoffee", "your-username");
builder.badge("GitHub", "your-username", "your-repo");
builder.badge("Twitter", "your-twitter-username");

Description: Adds a badge to the Markdown content for various services like BuyMeACoffee, GitHub, and Twitter.

Parameters:

|Parameter|Description| |:-|:-| |type|The type of badge (e.g., 'BuyMeACoffee', 'GitHub', 'Twitter').| |params|Parameters specific to the badge type.|