We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For arrays of length 30 or greater newline characters are inserted
example
const test31 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1]; const test20 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; > util.format(test20) '[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ]' > util.format(test31) '[ 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 0,\n 1 ]'
Originally discovered while debugging buynan (ticket here: trentm/node-bunyan#617)
Is there any way to suppress the newline characters?
The text was updated successfully, but these errors were encountered:
Yes; see the documentation:
breakLength <integer> The length at which an object's keys are split across multiple lines. Set to Infinity to format an object as a single line.
breakLength
integer
Infinity
So util.inspect(test31, { breakLength: Infinity }) does the trick.
util.inspect(test31, { breakLength: Infinity })
Sorry, something went wrong.
Thank you so much @addaleax! That did the trick!
No branches or pull requests
For arrays of length 30 or greater newline characters are inserted
example
Originally discovered while debugging buynan (ticket here: trentm/node-bunyan#617)
Is there any way to suppress the newline characters?
The text was updated successfully, but these errors were encountered: