get-md-title

1.0.4 • Public • Published

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

Package Sidebar

Install

npm i get-md-title

Weekly Downloads

18

Version

1.0.4

License

MIT

Last publish

Collaborators

  • iamstarkov