var fs = require('fs');
var extract = require('supermark-extract');
var markdown = fs.readFileSync('some-markdown-file.md', { encoding: 'utf8' });
var supermark = extract(markdown);
console.log(supermark);
{
"title": "Some document title",
"excerpt": "An excerpt of the document can be used in lists, RSS-feeds etc",
"slug": "some-document-title",
"date": "2015-12-30T00:11:19.411Z",
"status": "Draft",
"visibility": "Private",
"tags": ["List Of", "Random", "Tags"],
"categories": ["Testing", "Blogging"],
"author": "Espen Hovlandsdal <espen@hovlandsdal.com>",
"errors": [],
"intro": "Raw markdown source up to the first <!-- read more -->",
"document": "Raw markdown source of the document, without the supermark header."
}
MIT-licensed, see LICENSE.