Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bump and docs about {post,pre}Filter

  • Loading branch information...
commit 41ff25593e8814c79cc85647f4068106f4ea08cc 1 parent addf214
James Halliday authored September 19, 2011
18  README.markdown
Source Rendered
@@ -19,13 +19,14 @@ var fs = require('fs');
19 19
 var src = fs.readFileSync(__dirname + '/src.js');
20 20
 var stack = stackedy(src, { filename : 'stax.js' }).run();
21 21
 
22  
-stack.on('error', function (err) {
23  
-    console.log('Error: ' + err.message);
  22
+stack.on('error', function (err, c) {
  23
+    stack.stop();
  24
+    console.log('Error: ' + err);
24 25
     
25  
-    var c = err.current;
26  
-    console.log('  in ' + c.filename + ' at line ' + c.start.line);
  26
+    var cur = c.current;
  27
+    console.log('  in ' + cur.filename + ' at line ' + cur.start.line);
27 28
     
28  
-    err.stack.forEach(function (s) {
  29
+    c.stack.forEach(function (s) {
29 30
         console.log('  in ' + s.filename + ', '
30 31
             + s.functionName + '() at line ' + s.start.line
31 32
         );
@@ -58,8 +59,11 @@ stack.include(src, opts={})
58 59
 
59 60
 Include a source file body `src` into the current bundle.
60 61
 
61  
-`opts` can specify a `'filename'` key to augment the stack parameters with
62  
-filenames.
  62
+`opts.filename` will augment the stack with filename information.
  63
+
  64
+`opts.postFilter` transforms the source after transformation.
  65
+
  66
+`opts.preFilter` transforms the source before transformation.
63 67
 
64 68
 stack.run(context={}, opts)
65 69
 ---------------------------
2  package.json
... ...
@@ -1,7 +1,7 @@
1 1
 {
2 2
     "name" : "stackedy",
3 3
     "description" : "Roll your own stack traces and control program execution through AST manipulation",
4  
-    "version" : "0.1.0",
  4
+    "version" : "0.1.1",
5 5
     "repository" : {
6 6
         "type" : "git",
7 7
         "url" : "git://github.com/substack/node-stackedy.git"

0 notes on commit 41ff255

Please sign in to comment.
Something went wrong with that request. Please try again.