Skip to content

iamstarkov/get-md-title

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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