supermark-extract

1.0.6 • Public • Published

supermark-extract

Version npmBuild StatusDependenciesCoverage Status

Extract supermark properties from a markdown file

Installing

npm install --save supermark-extract

Usage

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);

Results in something along the lines of:

{
    "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."
}

Ecosystem

This is a submodule of supermark.

License

MIT-licensed, see LICENSE.

Package Sidebar

Install

npm i supermark-extract

Weekly Downloads

2

Version

1.0.6

License

MIT

Last publish

Collaborators

  • rexxars