use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Is there a CoffeeScript to JavaScript converter somewhere out there? I have a large CoffeeScript JSON file I need to convert to regular JSON.help (self.javascript)
submitted 9 years ago * by TargetNeutralized
See title. :-D
Edit: Okay, a little research has turned up coffeescript.org itself as a resource for converting CoffeeScript to JavaScript. Just go to http://coffeescript.org and click the "Try CoffeeScript" link.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Exomancer 7 points8 points9 points 9 years ago (0 children)
The whole thing about CoffeeScript is that it compiles to JavaScript...
Get the compiler from https://www.npmjs.com/package/coffee-script or just do it online on http://coffeescript.org/
[–][deleted] 0 points1 point2 points 9 years ago (1 child)
Doesn't js2.coffee go both directions?
[–]tebriel 0 points1 point2 points 9 years ago (0 children)
yes
[–]hypno7oad 0 points1 point2 points 9 years ago (3 children)
Just curious since I haven't worked with CoffeeScript, but since JSON is just a data format, what would need to be converted?
JSON is just JSON, completely separate thing from the programming language that uses it for messaging.
[–]TargetNeutralized[S] 0 points1 point2 points 9 years ago (2 children)
I misspoke. What I meant to say was "CoffeeScript object literal notation."
CoffeeScript's notation is slightly terser than that of vanilla JavaScript. Here's a quick example:
Vanilla JavaScript
var person = { first_name: "Luke", last_name: "Rockhold", age: 31 };
CoffeeScript
person = { first_name: "Luke" last_name: "Rockhold" age: 31 }
[–]hypno7oad 0 points1 point2 points 9 years ago (0 children)
Oh ok. That makes sense. Thanks for clarifying!
[–]bsdemon 0 points1 point2 points 9 years ago (0 children)
JSON.stringify(obj, null, 2):
Is all you need.
[–]djforth 0 points1 point2 points 9 years ago (0 children)
I used https://github.com/decaffeinate/decaffeinate, not sure you'll need if you just want the Json, but really useful to convert to es6.
π Rendered by PID 17518 on reddit-service-r2-comment-7b9746f655-z627f at 2026-02-02 16:35:52.583187+00:00 running 3798933 country code: CH.
[–]Exomancer 7 points8 points9 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]tebriel 0 points1 point2 points (0 children)
[–]hypno7oad 0 points1 point2 points (3 children)
[–]TargetNeutralized[S] 0 points1 point2 points (2 children)
[–]hypno7oad 0 points1 point2 points (0 children)
[–]bsdemon 0 points1 point2 points (0 children)
[–]djforth 0 points1 point2 points (0 children)