question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I recommend that Jasonette supports config files in the hjson format ( http://hjson.org/ )

This would demand a parsing of the config file after downloading it before using it as its used today.

Pure JSON would still work, but errors like an extra , after last element in an array would not spoil it all.

Another plus is that the developer can have comments in the config file and comment whole sections out (not possible with JSON)

Update: Inspired by http://nshipster.com/javascriptcore/ I have a feeling it could be implemented without much fuzz with JavaScriptCore

let configfileContent = sameWayToFetchFileAsToday();

do {  
	let hjsonSrc = try String(contentsOfFile: 'path/to/hjson.js', encoding: NSUTF8StringEncoding)  
} catch let error as NSError { print("Error: \(error)")  }

let context = JSContext()

context.evaluateScript("var hjson2json = function(hjson){ return JSON.stringify(Hjson.parse(hjson), null, 4); };")

let hjson2json = context.objectForKeyedSubscript("hjson2json")

let configJson = hjson2json.callWithArguments([configfileContent])

You might want to use the hjson.js file from http://hjson.org/js/hjson.js where its already “browserified”.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
marcelgleiscommented, Nov 6, 2016

my 2cts: we don’t need hjson

2reactions
gliechtensteincommented, Nov 4, 2016

Thanks for the suggestion! Let me look into HJSON. Will keep you posted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hjson, a user interface for JSON
Hjson is a syntax extension to JSON. It's NOT a proposal to replace JSON or to incorporate it into the JSON spec itself....
Read more >
Hjson for JavaScript - GitHub
Hjson is a syntax extension to JSON. It's NOT a proposal to replace JSON or to incorporate it into the JSON spec itself....
Read more >
hjson · PyPI
hjson -py. Hjson, a user interface for JSON. Hjson works with Python 2.5+ and Python 3.3+ (based on simplejson). Installation. pip install hjson....
Read more >
hjson - npm
A user interface for JSON.. Latest version: 3.2.2, last published: 2 years ago. Start using hjson in your project by running `npm i...
Read more >
serde_hjson - Rust - Docs.rs
What is Hjson? A configuration file format for humans. Relaxed syntax, fewer mistakes, more comments. See http://hjson.org.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found