D
Deno

help

how to break console.log maximum characters limit

GGH2/20/2024
hi, im using usual deno run file.ts command and realized that there is a limit to number characters that shown on console.log on my terminal(which is 100 characters), is there any workaround related to this?
DAHDeno AI Helper2/20/2024
I wasn't able to find the answer to your question in the official Deno documentation. Deno typically does not impose a limit on the number of characters that can be logged to the console; it's possible that the limit you're encountering is due to your terminal settings rather than Deno itself. However, based on the information you've provided, there are no obvious syntax errors or mistakes in your message. If you're experiencing a character limit, it might be worth checking your terminal settings or looking into whether any environment variables or configurations could be affecting the output of console.log. Please note that this advice is not based on the Deno documentation, and I would recommend double-checking the accuracy of this advice and exploring your terminal or shell documentation for more information on handling long lines of output.
LLeokuma2/20/2024
There's no limit If you are printing an object, maybe the object itself is truncating its textual representation, not console.log See: https://deno.land/api@v1.40.5?s=Deno.inspect
Deno
Deno.inspect | Runtime APIs | Deno
Converts the input into a string that has the same format as printed by console.log().
Rraunioroo2/20/2024
Console.log does abbreviate very long objects. Strings will never be abbreviated. If you want more control on how to print objects, you can explicitly convert your stuff to string, using for example JSON.stringify with parameters of your choice, eg. console.log(JSON.stringify(obj, null, 2)) There exists an open issue and/or a PR to increase the amount of characters printed by default by console.log([object]) to 10000, but afaik it hasn't been merged in yet. (personally I hope it won't be merged either, as I like the current default behaviour, but whatever 🤷 )
LLeokuma2/20/2024
Oh I thought the limit was implemented inside Deno.inspect, not in console.log
GGH2/21/2024
thanks @Leokuma @raunioroo
NNeTT2/21/2024
strings always get abbreviated in Deno tho
No description
Rraunioroo2/21/2024
I meant direct string arguments to console.log. Strings inside objects, arrays etc yeah thats different
NNeTT2/21/2024
It is a direct string argument tho Notice the .join at the end I just wanted a long string and couldn't bother holding the a for long Okay so the problem isn't with console.log Nvm It was the repl cutting the text off
Rraunioroo2/21/2024
Ohh. Yeah, didn't notice the join(). Weird, but as you said maybe it's the repl. I do a lot of IPC by just console.logging lines of JSON.stringified data to the parent process, and have never run into problems. The outputs can get occasionally large. If console.log did anything weird to those outputs, I'd have noticed if the outputs were not parseable as lines of JSON
NNeTT2/21/2024
I use the repl to quickly convert some text into JSON so it was pretty annoying that I always had to write the output to a file or use console.log (And I just realized that I could've used console.log)

Looking for more? Join the community!

Recommended Posts
npm import : class is not found but it is well declared in node_moduleI try to use Tatum SDK in deno (https://github.com/tatumio/tatum-js). I pick up the easiest code exaInteractive Jupyter notebookHas anyone figured out how to do interactivity in a Jupyter notebook with Deno kernel in VSCode? LiRun all pending ticks synchronouslyCurrently it seems like `run_event_loop` is the only way to run all the pending ops that are schedulHow can I do server sent events on the client side in deno?I have a server api which is doing server sent events correctly, I can see it in curl doing what I wunable to connect to mongodb using deno inside containerFirst of all, I want to mention that when I run `deno task preview` on my local machine / laptop, itTC39 stage 3 decorators not working anymore in Deno DeployAs of Feb 15th, deployments to #deploy™ fail when using TC39 decorators. Despite the decision to suUse Deno permissions in your own CLIIf I create a CLI with Deno, can I somehow reuse or pass on the permissions? ```bash > mycli --alloHas someone worked on a win32/x11/mac native window creation using FFI?Using only operating system native libraries? No SDL, etc.How to unset white background of SVG in Jupyter notebook?I’ve got a Jupyter notebook with Deno kernel in VSCode that displays an SVG. The SVG has a forced whHow to get the Docker ARM image for DenoI keep getting this error when trying to deploy my code: ``` WARNING: The requested image's platfoDeno compiled bin not create fileHi, I have a script that create file with Deno.writeFileSync() on current location When run script VSCode Extension Failing ot Initialize:party_deno: **RESOLVED** :party_deno: Having a bit of trouble using the VSCode Extension. `deno`deno command stdin, stdout continous readingI am trying to spawn an AI (cpp code) however after launching the code it immediately exits. It alsoProblem rerender a island when updating the value of a signal!Hi there im trying to make a visual change to the selected category button. However it does not rereCannot find namespace NodeJSHi Context: using deno with npm lib (imap). There seems to be a missing/unresolved to NodeJS that Which components exactly should be islands?Hi! I am currently developing a web app using fresh and I am getting confused about the usage of islError using npm:ssh2-sftp-client@10.0.3I am trying to connect to a sftp server using the library mentioned in the title (that is a wrapper How to restrict global scope in dynamically created function?I want to dynamically create a function using Function() constructor. How can I restrict access to gTyping for Dynamic importsSo I have a function like this that uses a dynamic import like ```ts export async function func1(imError with fetch called from npm moduleI am trying to use the `tsdav` NPM package with Deno, and have run into a problem with making an HTT