I think this can be:

```coffee
if stream instanceof Transform
  dmn = domain.create()
  dmn.on 'error', (err) ->
    dmn.dispose()
    stream.emit 'error', err
  stream._transform = domain.bind(stream._transform.bind(stream))
```

Also, if you're worried about the cost of creating a domain for every stream, you could instead make this take in the domain to use instead of creating it. Then you can use the same domain for all the streams in a pipeline. That would also allow give you more control of where you dispose it.