Closed julien-f closed 8 years ago
It should work. I have used it myself with node 4. Can you show me an example of something that doesn't work?
My bad, it works ^^
In fact I have a problem writing my own filter for stack-chain and I get all kind of errors which I have a hard time debugging.
Here is my code:
var sep = require('path').sep
var path = __dirname + sep + 'node_modules' + sep
require('stack-chain').filter.attach(function (_, frames) {
var filtered = frames.filter(function (frame) {
var name = frame && frame.getFileName()
return (
// has a filename
name &&
// contains a separator (no internal modules)
name.indexOf(sep) !== -1 &&
// does not start with the current path followed by node_modules.
name.lastIndexOf(path, 0) !== 0
)
})
// Do not returns an empty stack as it messes up with depd.
return filtered.length
? filtered
: frames
})
Sometimes depd
complains because the stack is empty (which I tried to fix with the ternary operator) and sometimes because the first frame is undefined
which should not be a result of my code :/
Any ideas?
Ok, It looks like depd
requires at least 3 frames in the stack.
Thanks anyway :)
It does not seems to work on my side, am I wrong?