1.0.0 • Published 3 years ago

gray-matter-editor v1.0.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
3 years ago

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

Usage

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

editor($FILE_PATH, (data) => ({
  ...data,
  author: 'yrobot',
}));
beforeafter
npm.ionpm.io
npm.ionpm.io
npm.ionpm.io

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