Permalink
Browse files

SourceMapping hack kinda works... :D

  • Loading branch information...
1 parent 8cbd279 commit fdd1887d0a9855ccfbe6c68541919e195a4f9c1a @xenomuta committed Aug 8, 2012
Showing with 38 additions and 9 deletions.
  1. +4 −0 .npmignore
  2. +33 −8 README.md
  3. BIN img/example.png
  4. +1 −1 package.json
View
@@ -0,0 +1,4 @@
+.npmignore
+npm-debug.log
+node_modules
+img
View
@@ -5,18 +5,43 @@ _makes debugging coffee-script easier by displaying corresponding lines of code
![Coffee-Trace](https://github.com/xenomuta/coffee-trace/raw/master/img/coffee-trace.png "Coffee-Trace")
### About Coffee-Trace
-If you love Coffee-Script and Node.js as much as me, you will provably also be frustrated by the challenges of quickly finding and debugging the corresponding javascript line on the stack-trace. I wrote Coffee-Trace in an attempt to make this task easier.
-
-I've been searching myself for a solution, and have found some very useful [links](http://www.adaltas.com/blog/2012/02/15/coffeescript-print-debug-line/ "Coffee script, how do I debug that damn js line?") and [discussions](https://github.com/jashkenas/coffee-script/issues/558 "links and discussions"), but am yet unsatisfied. So, while [SourceMaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ "SourceMaps") implementation in Coffee-Script is a reality, this is the least I can do.
+Coffee-Trace makes debugging coffeescript code easier by attempting to point corresponding coffeescript code and line numbers and styling the stacktrace a little bit.
-### Install Usage
+### Example
+Running this..
-Install with:
+coffeescript:
+ require '../'
+
+ test = ->
+ people =
+ john:
+ first_name: 'john'
+ last_name: 'doe'
+ mary:
+ first_name: 'mary'
+ last_name: 'jane'
+
+ console.log("Welcome", people[p].first_name, people[p].last_name, "!!!") for p in ['john', 'mary', 'josh']
+
+ process.nextTick test
+
+will result in this:
+![Coffee-Trace](https://github.com/xenomuta/coffee-trace/raw/master/img/example.png "Coffee-Trace example")
+
+
+### Why?
+If you love Coffee-Script and Node.js, you will provably also be frustrated by the challenges of quickly finding and debugging the coffeescript line corresponding to the one pointed out by the stack-trace.
+
+I've been searching a cleaner solution myself, and have found some very useful [links](http://www.adaltas.com/blog/2012/02/15/coffeescript-print-debug-line/ "Coffee script, how do I debug that damn js line?") and [discussions](https://github.com/jashkenas/coffee-script/issues/558 "links and discussions"), but am yet unsatisfied. So, while [SourceMaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ "SourceMaps") implementation in Coffee-Script is a reality, this is the least I can do.
+
+### Install and Usage
+Become a masochist by enjoying `uncaughtExceptions` and crashes. Just by installing with:
`npm install coffee-trace`
-Become a masochist by enjoying uncaught exceptions and crashes. Just `require()` it at the very beginning of your code...
+and `require()`ing at the very beginning of your code...
### Utopic Future (High Hopes)
-I have this crazy idea that someday I'll have some time to make this show the actual coffee-script line corresponding to the trace.
-That's right boyz, full source mapping.
+* Testing ( make something crash the way expected )
+* Beautify and comment code
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,5 +1,5 @@
{ "name": "coffee-trace"
-, "version": "1.2.8"
+, "version": "1.3.0"
, "engines": ["node >= 0.4.0"]
, "main": "./lib/coffee-trace.coffee"
, "dependencies": {

0 comments on commit fdd1887

Please sign in to comment.