I'm trying to omit this kind of data from a class that inherits from node.js-stream when doing a console.log()
:
asset:
PassThrough {
filename: 'old_man',
data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 f0 00 f0 00 00 ff db 00 43 00 05 03 04 04 04 03 05 04 04 04 05 05 05 06 07 0c 08 07 07 07 07 0f 0b 0b 09 ... >,
originalLocation: '/path/to/lib/image.jpg',
contentType: [Getter/Setter],
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
... etc.
Normally I'd try something like:
Object.defineProperty(self, 'PassThrough', {
configurable: true,
writable: true,
enumerable: false
})
But because PassThrough
isn't actually a property of the object, it doesn't work. How can I hide the stream information from console.log()
?
(Disclaimer: I do realize it's by design and that it's probably a bad idea to hide it ;)