1.0.4 • Published 9 years ago

get-md-title v1.0.4

Weekly downloads
4,580
License
MIT
Repository
github
Last release
9 years ago

get-md-title

NPM version Build Status Coveralls Status Dependency Status

get title from markdown article

Install

npm install --save get-md-title

Usage

import getTitle from 'get-md-title';

const input = `
# awesome *heading*

# second heading

paragragh`;

getTitle(input).text; // awesome heading
getTitle(input).html; // awesome <em>heading</em>
getTitle(input).node; // AST node, see commonmark API
getTitle('');         // undefined ¯\_(ツ)_/¯

API

getTitle(input)

input

Required
Type: String

Markdown string.

Related

License

MIT © Vladimir Starkov