Skip to content

yrobot-npm/gray-matter-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gray-matter-editor

an esay way to edit gray-matter-data in nodejs

Install

Install with npm:

$ npm install --save gray-matter-editor

ChangeLog

Please see the changelog

Warning

BACKUP before using gray-matter-editor

使用gray-matter-editor前,请备份文件

Usage

const editor = require('gray-matter-editor');

editor($FILE_PATH, (data) => ({
  ...data,
  author: 'yrobot',
}));
before after

API

Params

  • path {String}: file path
  • transform-hook {Function: Object => Object}: oldData=>newData, call with old matter-data, return new matter-data
  • options {Object} {delims = '---'}

About

an esay way to edit gray-matter-data in nodejs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published