{"id":21158233,"url":"https://github.com/simbo/gulp-gray-matter","last_synced_at":"2025-06-21T08:06:50.511Z","repository":{"id":57257695,"uuid":"51027905","full_name":"simbo/gulp-gray-matter","owner":"simbo","description":"A gulp plugin for extracting data header from file contents using gray-matter.","archived":false,"fork":false,"pushed_at":"2019-01-29T02:32:45.000Z","size":17,"stargazers_count":3,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T08:06:19.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-03T20:21:54.000Z","updated_at":"2019-12-04T10:24:54.000Z","dependencies_parsed_at":"2022-08-25T21:23:33.259Z","dependency_job_id":null,"html_url":"https://github.com/simbo/gulp-gray-matter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/simbo/gulp-gray-matter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fgulp-gray-matter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fgulp-gray-matter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fgulp-gray-matter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fgulp-gray-matter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbo","download_url":"https://codeload.github.com/simbo/gulp-gray-matter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fgulp-gray-matter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261083449,"owners_count":23107114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T12:18:57.954Z","updated_at":"2025-06-21T08:06:45.492Z","avatar_url":"https://github.com/simbo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"gulp-gray-matter\n================\n\n\u003e A *gulp* plugin for extracting data header from file contents using *gray-matter*.\n\n\u003e *\"See the [benchmarks](https://www.npmjs.com/package/gray-matter#benchmarks). gray-matter is 20-30x faster than front-matter.\"*\n\u003e ([@jonschlinkert](https://www.npmjs.com/~jonschlinkert))\n\n[![npm Package Version](https://img.shields.io/npm/v/gulp-gray-matter.svg?style=flat-square)](https://www.npmjs.com/package/gulp-gray-matter)\n[![MIT License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://simbo.mit-license.org)\n[![Travis Build Status](https://img.shields.io/travis/simbo/gulp-gray-matter/master.svg?style=flat-square)](https://travis-ci.org/simbo/gulp-gray-matter)\n[![Codecov Test Coverage](https://img.shields.io/codecov/c/github/simbo/gulp-gray-matter.svg?style=flat-square)](https://codecov.io/github/simbo/gulp-gray-matter)\n[![Dependencies Status](https://img.shields.io/david/simbo/gulp-gray-matter.svg?style=flat-square\u0026label=deps)](https://david-dm.org/simbo/gulp-gray-matter)\n[![devDependencies Status](https://img.shields.io/david/dev/simbo/gulp-gray-matter.svg?style=flat-square\u0026label=devDeps)](https://david-dm.org/simbo/gulp-gray-matter#info=devDependencies)\n\n---\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [About](#about)\n- [Setup and usage](#setup-and-usage)\n- [Options](#options)\n  - [property](#property)\n  - [remove](#remove)\n  - [trim](#trim)\n  - [setData](#setdata)\n- [License](#license)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n---\n\n## About\n\n*gulp-gray-matter* is a plugin for [gulp](http://gulpjs.com/), to extract data \nheaders from file contents using [gray-matter](https://www.npmjs.com/package/gray-matter).\n\nThe extracted data is set as a property of the file object for further processing.\nYou can customize the property name and also use nested properties (via\n[object-path](https://www.npmjs.com/package/object-path)).\n\nIf the file object already has data attached on the defined property, existing\ndata will be merged recursively with extracted data (using \n[merge](https://www.npmjs.com/package/object-path)). You can define a custom \nfunction for setting data to change this behavior.\n\nThere are further [custom options](#options) and of course you can also use all\n[gray-matter options](https://www.npmjs.com/package/gray-matter#options).\n\n\n## Setup and usage\n\nInstall `gulp-gray-matter` using `npm`:\n\n```sh\nnpm i gulp-gray-matter\n```\n\nIn your `gulpfile.js`:\n\n```js\nvar gulp = require('gulp'),\n    gulpGrayMatter = require('gulp-gray-matter');\n\ngulp.task('default', function() {\n  return gulp.src('./src/**.*')\n    .pipe(gulpGrayMatter({ /* options */ }))\n    // …\n    .pipe(gulp.dest('./dest'));\n});\n```\n\nA common workflow, after extracting front matter, could be using a template \nrendering plugin like [gulp-jade](https://www.npmjs.com/package/gulp-jade).\n\n\n## Options\n\nBeside its own options, *gulp-gray-matter* also supports all\n[gray-matter options](https://www.npmjs.com/package/gray-matter#options):\n`delims`, `eval`, `lang` and `parser`\n\n\n### property\n\n*String*\n\nDefault: `'data'`\n\nThe file object property for setting data. can also be a nested property name\nlike `foo.bar.baz`.\n\n\n### remove\n\n*Boolean*\n\nDefault: `true`\n\nWhether data header should be removed from file contents or not.\n\n\n### trim\n\n*Boolean*\n\nDefault: `true`\n\nWhether file contents should be trimmed after removing file header or not.\n(has no effect if `options.remove` is `false`.)\n\n\n### setData\n\n*Function*\n\nDefault: \n\n```js\nfunction setData(oldData, newData) {\n  return require('merge').recursive(oldData, newData);\n}\n```\n\nIf there is already data attached to the file object on the property defined \nwith `options.property`, existing data will be recursively merged with extracted\ndata. Set your own function to change this behavior.\n\n\n## License\n\n[MIT \u0026copy; 2016 Simon Lepel](http://simbo.mit-license.org/)\n\nBefore version 2.2.2, [@jakwings](https://www.npmjs.com/~jakwings) was the \noriginal author and owner of the npm package *gulp-gray-matter*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fgulp-gray-matter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbo%2Fgulp-gray-matter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fgulp-gray-matter/lists"}