Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
farskid opened this issue Jan 5, 2022 · 1 comment
Open

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

farskid opened this issue Jan 5, 2022 · 1 comment

Comments

@farskid
Copy link

farskid commented Jan 5, 2022

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 🙏

@farskid farskid closed this as completed Jan 5, 2022
@farskid farskid reopened this Jan 5, 2022
@KamilDev
Copy link

Do you know if this is a feature of the library? I was also wondering the same thing for performance, since I'm only interested in the frontmatter values.

NodeJS seems to support line-by-line reading: https://nodejs.org/api/readline.html#readline_example_read_file_stream_line_by_line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants