-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Making util.inspect
recurse indefinitely by passing Infinity
instead of null
#20366
Comments
A documentation update like that would indeed be welcome. It should still say that |
@BridgeAR Should the code be updated, too? For example, should the default options be changed? Lines 81 to 83 in 2b85127
Haven't looked into it too deeply yet, but I suspect there might be other places that probably should be updated, too. |
Personal opinion, while we still need to support |
Second time contributor here. Sorry I missed that. Seems like that change was already done as part of #17907, which is a semver major change (if I understood correctly, because the default depth was changed from Do you still think it's a good idea to just change the docs and change the internal implementation so it is a non-breaking change (more or less, |
It is already possible to do that right now and there should not be any difference for a user if that is documented or not. I suggest to target 10.x to update the docs there.
That is correct and it is currently unclear if that will be reverted or not. It is definitely going to get a change, how ever that will look like. |
Closing this as the current documentation already mentions |
Now the format of the output file is combined into a full object, which is then used by the main file, rather than importing all of the arguments as individual flags. Added a flag to specify the SNBT indentation spacing! It was only set to 2 before, now you can have fully minified SNBT, or use any indentation you'd like. Like the programming NBTify API, it accepts a number or a string. Removed the `--pipe` flag, in favor of simply specifying whether you want to use an NBT or SNBT output to stdout. If neither `--nbt` or `--snbt` are passed as flags, it will simply log out the structure of the file, with nice pretty-printing, colors, and such, as it currently has been doing thus far. The pretty-print logging now fully logs out the NBT file's tree, other than for TypedArray-based tags. For everything else though, you see all of it's content, rather than being abbreviated (the normal behavior for `console.log()` in Node.js). Learned about the difference between `isNan()` and `Number.isNaN()`. The first one coerces the input value, checks if it's `NaN`, while the other simply checks what it is currently (doesn't convert to `number` first). #25 microsoft/TypeScript#31025 https://stackoverflow.com/questions/56143158/how-to-use-util-promisify-and-bind-functions-in-nodejs (I think I ran into this issue previously, but I didn't know that function binding would work nicely here!) https://stackoverflow.com/questions/43362222/nodejs-short-alias-for-process-stdout-write https://askubuntu.com/questions/510890/how-do-i-redirect-command-output-to-vim-in-bash (Looked into this again, was curious in whether it's viable to edit SNBT with Vim again) Oh yeah, that reminds me, I also made it so SNBT is added to stdout with a trailing `\n`, so it nicer looking in the terminal, as well as in the editor, as most editors utilize trailing new lines. I think those are finally catching on with me! They really bugged me for some reason, since the start of my programming lol. Now I'm getting Linux'ed haha. nodejs/node#20366 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN https://www.google.com/search?q=comments+in+powershell
I'm wondering about the
depth
option forutil.inspect
.The documentation states "To make it recurse indefinitely, pass
null
."I think it would be more intuitive to pass
Infinity
to make it recurse indefinitely.Would a change like this be accepted?
The text was updated successfully, but these errors were encountered: