jonschlinkert / gray-matter

Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert
https://github.com/jonschlinkert
MIT License
3.91k stars 138 forks source link

Skip reading the content of the file once front matter is parsed #133

Open farskid opened 2 years ago

farskid commented 2 years ago

Hi, thanks for the great library.

I was wondering if there is a way to configure gray-matter to skip reading large content of files with front matter once it found the front matter?

I'm dealing with large MDX files with significant amount of content which delay the load metrics. Happy to hear a work-around as well 🙏