gray-matter-editor

1.0.0 • Public • Published

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 = '---'}

/gray-matter-editor/

    Package Sidebar

    Install

    npm i gray-matter-editor

    Weekly Downloads

    0

    Version

    1.0.0

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    4.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • yrobot