better-buffer-inspect
better-buffer-inspect makes util.inspect(aBuffer)
show the size of
a node Buffer, as well as its text content if it is <= 512 bytes and
decodes as UTF-8.
Install
In your project, run:
npm install better-buffer-inspect --save
or install from the GitHub repo:
npm install ludios/better-buffer-inspect --save
API
Requiring better-buffer-inspect
will override Buffer.prototype.inspect
.
> ; > 4<Buffer size=4: ff ff ff ff> > "hello world\n"<Buffer size=11: utf8 'hello world\n'> > "\ucccc"<Buffer size=3: utf8 '쳌'>