{"id":18434697,"url":"https://github.com/assemble/assemble-front-matter","last_synced_at":"2025-07-09T19:39:37.040Z","repository":{"id":10010350,"uuid":"12046940","full_name":"assemble/assemble-front-matter","owner":"assemble","description":"Utilities for extracting Front Matter from source files.","archived":false,"fork":false,"pushed_at":"2013-09-28T04:07:49.000Z","size":121,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-24T08:20:09.680Z","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/assemble.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-12T03:16:57.000Z","updated_at":"2017-03-26T16:31:29.000Z","dependencies_parsed_at":"2022-09-26T17:40:59.777Z","dependency_job_id":null,"html_url":"https://github.com/assemble/assemble-front-matter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/assemble/assemble-front-matter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-front-matter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-front-matter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-front-matter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-front-matter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assemble","download_url":"https://codeload.github.com/assemble/assemble-front-matter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fassemble-front-matter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261682921,"owners_count":23193677,"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-06T06:04:58.214Z","updated_at":"2025-07-09T19:39:36.971Z","avatar_url":"https://github.com/assemble.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assemble-front-matter [![NPM version](https://badge.fury.io/js/assemble-front-matter.png)](http://badge.fury.io/js/assemble-front-matter)  [![Build Status](https://travis-ci.org/assemble/assemble-front-matter.png)](https://travis-ci.org/assemble/assemble-front-matter)\n\n\u003e Utilities for extracting front matter from source files.\n\nVisit [Assemble's documentation](http://assemble.io) for many more examples and pointers on getting started.\n\n## Getting Started\n```shell\nnpm install assemble-front-matter --save\n```\n\nand use it as follows:\n\n```js\nvar yfm = require('assemble-front-matter');\n```\n\n\n## Methods\n#### extract\nExtract YAML front matter and content from files.\n\n```js\nvar raw = yfm.extract(\"./file.hbs\", opts);\n```\n**Parameters**:\n\n* `String`: The file to read.\n* `Object`: The options object to pass to [js-yaml](https://github.com/nodeca/js-yaml)\n\n**Returns**:\n\nObject with three properties\n\n```js\n{\n \"context\": {}         // Object. YAML front matter returned as a JSON object.\n \"content\": \"\"         // String. File content, stripped of YAML front matter\n \"originalContent\": \"\" // String. Both content and YAML front matter.\n}\n```\n\n#### context\n\nReturn YAML front matter as a JSON object.\n\n```js\nvar data = yfm.extract(\"./file.hbs\").context;\n```\n\nAlias:\n\n```js\nvar data = yfm.extractJSON(\"./file.hbs\");\n```\n\n#### content\n\nReturn the content of a file, with YAML front matter removed.\n\n```js\nvar content = yfm.extract(\"./file.hbs\").content;\n```\n\nAlias:\n\n```js\nvar data = yfm.stripYFM(\"./file.hbs\");\n```\n\n\n\n## Release History\n\n * 2013-09-22   v0.1.2   Adds grunt-readme and grunt-pkg-sync\n * 2013-09-02   v0.1.1   Updates tests and example files\n * 2013-08-11   v0.1.0   Initial setup\n \n\n## Author\n\n+ [github.com/doowb](https://github.com/doowb)\n+ [twitter.com/doowb](http://twitter.com/doowb)\n\n## License\nCopyright (c) 2013 Brian Woodward, contributors.\nReleased under the MIT license\n\n***\n\n_This file was generated on Mon Sep 02 2013 09:44:51._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fassemble-front-matter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemble%2Fassemble-front-matter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fassemble-front-matter/lists"}