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

@discord-util/markdown

v1.0.0

Published

A module for manage and parse markdown syntax of discord.

Downloads

90

Readme

Discord-markdown

This module provides utilities functions for manipulate markdown with discord.

Getting started

Installation

With npm :

npm install @discord-util/markdown

With yarn :

yarn add @discord-util/markdown

Import module

CommonJS syntax :

const {
  MarkdownBuild,
  MarkdownParser,
  MarkdownEscaper,
} = require("@discord-util/markdown");

Module ES syntax :

import {
  MarkdownBuild,
  MarkdownParser,
  MarkdownEscaper,
} from "@discord-util/markdown";

[static] MarkdownBuild#bold(text)

Return text formatted with bold

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.bold("Hello world"));

[static] MarkdownBuild#italic(text)

Return text formatted with italic

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.italic("Hello world"));

[static] MarkdownBuild#underline(text)

Return text formatted with underline

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.underline("Hello world"));

[static] MarkdownBuild#strikethrough(text)

Return text formatted with strikethrough

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.strikethrough("Hello world"));

[static] MarkdownBuild#code(text)

Return text formatted with code

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.code("Hello world"));

[static] MarkdownBuild#codeBlock(text)

Return text formatted with codeBlock

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.codeBlock("Hello world"));

[static] MarkdownBuild#quote(text)

Return text formatted with quote

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.quote("Hello world"));

[static] MarkdownBuild#quoteBlock(text)

Return text formatted with quoteBlock

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.quoteBlock("Hello world"));

[static] MarkdownBuild#spoiler(text)

Return text formatted with codeBlock

Params :

  • text : The text to formatted (string)

Return :

The text formatted (string)

console.log(MarkdownBuild.codeBlock("Hello world"));

[static] MarkdownEscaper#bold(text)

Return text with bold escaped.

Params :

  • text : The text to escaped (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.bold("Hello world"));

[static] MarkdownEscaper#italic(text)

Return text with italic escaped.

Params :

  • text : The text to escaped (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.italic("Hello world"));

[static] MarkdownEscaper#underline(text)

Return text with underline escaped.

Params :

  • text : The text to escaped (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.underline("Hello world"));

[static] MarkdownEscaper#spoiler(text)

Return text with spoiler escaped.

Params :

  • text : The text to escaped (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.spoiler("Hello world"));

[static] MarkdownEscaper#codeBlock(text)

Return text with code block escaped.

Params :

  • text : The text to escaped (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.codeBlock("Hello world"));

[static] MarkdownEscaper#inlineCode(text)

Return text with inline code escaped.

Params :

  • text : The text to escaped (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.inlineCode("Hello world"));

[static] MarkdownEscaper#strikethrough(text)

Return text with bold escaped.

Params :

  • text : The text to strikethrough (string)

Return :

The text escaped (string)

console.log(MarkdownEscaper.strikethrough("Hello world"));

[static] MarkdownParser#emoji(text)

Return id of emojis.

Params :

  • text : The text to parsed (string)

Return :

An object with name and if of emoji and if is animated

console.log(MarkdownParser.emoji("Hello world <a:name:0000>"));

[static] MarkdownParser#channel(text)

Return id of channels.

Params :

  • text : The text to parsed (string)

Return :

An array of id of channels (Array<string>)

console.log(MarkdownParser.channel("Hello world <#0000000>"));

[static] MarkdownParser#role(text)

Return id of roles.

Params :

  • text : The text to parsed (string)

Return :

An array of id of roles (Array<string>)

console.log(MarkdownParser.role("Hello world <@&000000>"));

[static] MarkdownParser#guildEmoji(text)

Return id of emojis.

Params :

  • text : The text to parsed (string)

Return :

An array of id of emojis (Array<string>)

console.log(MarkdownParser.guildEmoji("Hello world <a:name:0000>"));

[static] MarkdownParser#user(text)

Return id of users.

Params :

  • text : The text to parsed (string)

Return :

An array of id of users (Array<string>)

console.log(MarkdownParser.user("Hello world <@0000000>"));

[static] MarkdownParser#userNickname(text)

Return id of users.

Params :

  • text : The text to parsed (string)

Return :

An array of id of users (Array<string>)

console.log(MarkdownParser.user("Hello world <@0000000>"));