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

Alternatively accept _data.js for metadata instead of plain JSON? #8

Open
sgoumaz opened this issue Oct 2, 2013 · 5 comments
Open
Milestone

Comments

@sgoumaz
Copy link

sgoumaz commented Oct 2, 2013

Originally: sintaxi/harp#103

This gist works for me (no edge case checks done though, that's for tests).

@sintaxi
Copy link
Owner

sintaxi commented Oct 2, 2013

You have peaked my curiosity, but it still isn't clear to me how one would use this. Can you give me an example of what a typical data.js might look like?

@sgoumaz
Copy link
Author

sgoumaz commented Oct 2, 2013

Sure, I updated the gist with a _data.js. For such a simple case, the only differences with a _data.json are the module.exports = wrapping and the require() loading stuff from another file (which is what I want).

@sgoumaz
Copy link
Author

sgoumaz commented Oct 4, 2013

Just in case, FYI I adjusted the gist code with those fixes:

  1. live updates to _data files weren't picked because of require() caching
  2. commented out obsolete line in catch block

@jamesknelson
Copy link

Just in case anybody would still like to know of use cases for this, there is the fact helper functions could be placed in _data.js. Also, if .coffee was also supported, it would allow a much nicer format for writing it.

@sehrope
Copy link
Contributor

sehrope commented Jan 5, 2015

Did this ever go anywhere?

I've run into a similar use case (using harp) that would be covered by being able to include JS functions via a _data.js (vs _data.json).

Also, I'd be a fan of allowing .coffee extensions as well though .js itself would be fine.

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

5 participants