1.0.0 • Published 4 years ago

discord-md-tags v1.0.0

Weekly downloads
162
License
MIT
Repository
github
Last release
4 years ago

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, quote.

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***"
1.0.0

4 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago