Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bump and docs about {post,pre}Filter

  • Loading branch information...
commit 41ff25593e8814c79cc85647f4068106f4ea08cc 1 parent addf214
@substack authored
Showing with 12 additions and 8 deletions.
  1. +11 −7 README.markdown
  2. +1 −1  package.json
View
18 README.markdown
@@ -19,13 +19,14 @@ var fs = require('fs');
var src = fs.readFileSync(__dirname + '/src.js');
var stack = stackedy(src, { filename : 'stax.js' }).run();
-stack.on('error', function (err) {
- console.log('Error: ' + err.message);
+stack.on('error', function (err, c) {
+ stack.stop();
+ console.log('Error: ' + err);
- var c = err.current;
- console.log(' in ' + c.filename + ' at line ' + c.start.line);
+ var cur = c.current;
+ console.log(' in ' + cur.filename + ' at line ' + cur.start.line);
- err.stack.forEach(function (s) {
+ c.stack.forEach(function (s) {
console.log(' in ' + s.filename + ', '
+ s.functionName + '() at line ' + s.start.line
);
@@ -58,8 +59,11 @@ stack.include(src, opts={})
Include a source file body `src` into the current bundle.
-`opts` can specify a `'filename'` key to augment the stack parameters with
-filenames.
+`opts.filename` will augment the stack with filename information.
+
+`opts.postFilter` transforms the source after transformation.
+
+`opts.preFilter` transforms the source before transformation.
stack.run(context={}, opts)
---------------------------
View
2  package.json
@@ -1,7 +1,7 @@
{
"name" : "stackedy",
"description" : "Roll your own stack traces and control program execution through AST manipulation",
- "version" : "0.1.0",
+ "version" : "0.1.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/node-stackedy.git"
Please sign in to comment.
Something went wrong with that request. Please try again.