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

Open
opened 2022-01-05 12:25:49 +00:00 by farskid · 2 comments
farskid commented 2022-01-05 12:25:49 +00:00 (Migrated from github.com)

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 🙏

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 🙏
KamilDev commented 2024-12-19 07:08:46 +00:00 (Migrated from github.com)

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

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
phoneticallySAARTHaK commented 2025-01-30 16:01:40 +00:00 (Migrated from github.com)

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

Looks like I'll just use that and use a yaml parser

> 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 Looks like I'll just use that and use a yaml parser
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rtlabs-llm-agents/gms-gray-matter#133
No description provided.