an esay way to edit gray-matter-data in nodejs
Install with npm:
$ npm install --save gray-matter-editorPlease see the changelog
const editor = require('gray-matter-editor');
editor($FILE_PATH, (data) => ({
...data,
author: 'yrobot',
}));| before | after |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Params
path{String}: file pathtransform-hook{Function: Object => Object}: oldData=>newData, call with old matter-data, return new matter-dataoptions{Object} {delims = '---'}





