Comments (10)
what if we did gray-matter-lite
or something, then we could require that into this module for the time being to keep the API the same here.
from gray-matter.
This is working as of version 3.0.6. Thanks!
from gray-matter.
This is working as of version 3.0.6. Thanks!
Great! I was going to ask. Thanks!
from gray-matter.
just saw this comment. That might be a solution too.
from gray-matter.
Another way that would work for us if you don't want to change the sources would be to have a re-packaged version for browsers that was run through Babel or something like that and left out the Node functions like
matter.read
/fs
.
If we did it that way, then you should be able to build the sources however you want, then publish it as two separate packages (maybe gray-matter
and gray-matter-browser
or something like that).
from gray-matter.
If we did it that way, then you should be able to build the sources however you want, then publish it as two separate packages (maybe gray-matter and gray-matter-browser or something like that).
yeah, that's not a bad idea. Let me think about it for a little bit (today). @doowb?
from gray-matter.
Another option if we are just considering fs
is wrapping the require
in an if
:
if (require) { require('fs'); }
I'd still have to test this though, I'm not sure that it works with WebPack.
from gray-matter.
That sounds really good.
from gray-matter.
I like the idea of having a separate module with browser compatible features that is then required into gray-matter
.
The if(require) { require('fs'); }
won't work for webpack because webpack does static analysis to determine which modules to include by looking at the require
keyword.
Another option that might work is for gray-matter
to add a browser
property to package.json
with {"fs": false}
since webpack supports the package browser field spec now. I haven't tested this to know if it would work for you or not.
from gray-matter.
That would be awesome.
from gray-matter.
Related Issues (20)
- Max Integer Size HOT 1
- apostrophe in frontmatter HOT 2
- Can't parse datetime format
- ReferenceError: Buffer is not defined HOT 6
- typescript issues - is this package deprecated?
- Can't get values of double-nested entries
- Passing environment variable to the yaml file header HOT 2
- (Request) Any way to generate "square bracket" arrays rather than lists? HOT 1
- Add support for async excerpt functions? HOT 2
- Some kind of unwanted caching behaviour?
- `file.isEmpty` is not documented in typings
- gray-matter seems to be broken in Next 13 HOT 2
- Add Superscript Support
- Image for sponsorships
- android app issues
- Invalid front-matter should not be cached
- adding colon inside string breaks gray-matter parsing HOT 1
- Add Generic Data Typing for matter Frontmatter Parsing HOT 4
- Expose `YAMLException` from `js-yaml`
- The `excerpt` function option should be a function that returns a string, but it isn't HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gray-matter.