A simple library to read / write / create markdown files of hexo blog posts.
Read your hexo markdown file and parse it to an FrontMatterData object.
- from / the path of your post markdown file.
returns Promise<FrontMatterData
result>
Create an FrontMatterData object.
returns FrontMatterData
result;
- initObj / a FrontMatterData object
- to / the output markdown file path.
It just a simple key-value pair handler.
Add a key-value pair;
Remove key-value pair;
Set an exist key with a new value. If key doesn't exist in object, it will add a new key-value pair instead.
All methods in FrontMatterData
, you always should not to use Object (Date/Array/null are not included) as your value
input.
When you use Editor.write()
to output your FrontMatterData
to a markdown file(s), that Object value will be transformed to "[Object Object]"
.
This is the default behavior of hexo-front-matter.