https://github.com/maxhoffmann/frontmd2json
convert markdown files with frontmatter to json
https://github.com/maxhoffmann/frontmd2json
Last synced: 5 months ago
JSON representation
convert markdown files with frontmatter to json
- Host: GitHub
- URL: https://github.com/maxhoffmann/frontmd2json
- Owner: maxhoffmann
- License: mit
- Created: 2014-11-30T14:25:15.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T09:06:08.000Z (over 11 years ago)
- Last Synced: 2025-02-23T17:17:03.189Z (about 1 year ago)
- Language: JavaScript
- Size: 207 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
frontmd2json
============
convert markdown files with frontmatter to json
Installation
------------
```
npm install frontmd2json -g
```
Usage
-----
```
frontmd2json **/*.markdown
```
JavaScript
----------
```js
var frontmd2json = require('frontmd2json')
var json = frontmd2json(['**/*.markdown', '**/*.md'])
```
Example
-------
__Input__
```markdown
---
date: 2014-11-02
---
# Headline
Paragraph
```
__Output__
```json
[
{
"meta": {
"date": "2014-11-02T00:00:00.000Z",
"_markdown": "# Headline\nParagraph",
"_path": "path/to/file/"
},
"html": "
Headline
Paragraph
"
}
]
```