Markdown
/ API Reference
Markdown
/ API Reference

getWordCount

Counts the number of words in a markdown string.

The Gist

import { getWordCount } from '@weser/markdown'

const markdown = `Hello World`
const wordCount = getWordCount(markdown)

console.log(wordCount)
// 2

Parameters

ParameterTypeDescription
markdownstringThe markdown string to count the words of.

Returns

(number) The number of words in the markdown string.

On this page