better-buffer-inspect
v0.1.4
Published
Monkeypatch Buffer.prototype.inspect to show size and also text content if UTF-8
Downloads
3
Readme
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
.
> require('better-buffer-inspect');
> new Buffer(4).fill(255)
<Buffer size=4: ff ff ff ff>
> new Buffer("hello world\n")
<Buffer size=11: utf8 'hello world\n'>
> new Buffer("\ucccc")
<Buffer size=3: utf8 '쳌'>