Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Inspect method of buffers is missing description #3918

Closed
a0viedo opened this issue Nov 19, 2015 · 8 comments
Closed

doc: Inspect method of buffers is missing description #3918

a0viedo opened this issue Nov 19, 2015 · 8 comments
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. question Issues that look for answers.

Comments

@a0viedo
Copy link
Member

a0viedo commented Nov 19, 2015

buffer.inspect() is referenced at Buffer#INSPECT_MAX_BYTES but no description is found on the same document. Is this intended? It's an internal method only?

@mscdex
Copy link
Contributor

mscdex commented Nov 19, 2015

The answer is in the documentation for util.inspect(). Basically any object can implement an inspect() method that will get used by util.inspect() when inspecting that object, so that you can format your object value however you want.

It's kind of like how you can add a .toJSON() method to an object and the value returned by it will be used by JSON.stringify() instead of the default formatting/toString().

@mscdex mscdex added question Issues that look for answers. buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Nov 19, 2015
@cjihrig
Copy link
Contributor

cjihrig commented Nov 19, 2015

Maybe that reference to buffer.inspect() should link to util.inspect().

@Fishrock123
Copy link
Contributor

^

@mscdex
Copy link
Contributor

mscdex commented Nov 19, 2015

I agree the documentation could be better here, but linking buffer.inspect() itself to somewhere outside of the Buffer documentation page might be a little confusing?

@cjihrig
Copy link
Contributor

cjihrig commented Nov 19, 2015

Then at least a note saying see util.inspect() for more information. Something to get people there.

@mscdex
Copy link
Contributor

mscdex commented Nov 19, 2015

Something like that is fine by me.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 19, 2015

PR - #3921

cjihrig added a commit to cjihrig/node that referenced this issue Nov 19, 2015
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: nodejs#3918
PR-URL: nodejs#3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
@a0viedo
Copy link
Member Author

a0viedo commented Nov 19, 2015

@cjihrig @mscdex awesome! thanks

cjihrig added a commit that referenced this issue Dec 1, 2015
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: #3918
PR-URL: #3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
cjihrig added a commit that referenced this issue Dec 4, 2015
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: #3918
PR-URL: #3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
cjihrig added a commit that referenced this issue Dec 5, 2015
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: #3918
PR-URL: #3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
cjihrig added a commit that referenced this issue Dec 17, 2015
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: #3918
PR-URL: #3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
cjihrig added a commit that referenced this issue Dec 23, 2015
This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: #3918
PR-URL: #3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

4 participants