Skip to content
A collection of tag functions for discord markdown
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
scripts
src
test
.eslintrc.json
.gitignore
.npmignore
LICENSE
README.md
azure-pipelines.yml
package.json
tsconfig.json
yarn.lock

README.md

discord-md-tags

A collection of tag functions for discord markdown

These are Tag Functions for use with Tagged Templates

Usage is simple:

const { bold, italic } = require('discord-md-tags');

console.log(bold `text`);
// Logs: "**text**"

console.log(bold `bold ${italic `bold and italic`}`);
// Logs: "**bold *bold and italic***"

This works the same for italic, underline, code, spoiler, strikethrough.

codeblock also works the same, but has a bit more:

const { codeblock } = require('discord-md-tags');

console.log(codeblock `text`);
// Logs: "```\ntext```"

console.log(codeblock('md') `text`);
// Logs: "```md\ntext```"

Find the native javascript nesting a bit ugly? Find beauty by making composite formats with the included compose util!

const { bold, italic, compose } = require('discord-md-tags');

// :(
console.log(bold `${italic `text`}`);
// Logs: "***text***"

// :)
console.log(compose(bold, italic) `text`);
// Logs: "***text***"
You can’t perform that action at this time.