GithubHelp home page GithubHelp logo

Newlines about avsc HOT 4 CLOSED

mtth avatar mtth commented on May 12, 2024
Newlines

from avsc.

Comments (4)

mtth avatar mtth commented on May 12, 2024

Hey, you should transform your output to a string before passing it to console.log, for example via: console.log(JSON.stringify(object)).

Related to #32, this is due to console.log behavior. Its output is meant to be "human friendly", so it decorates the objects returned (for example by adding the constructor's name in front) and indents it in a "hard-to-parse" way.

from avsc.

x10ba avatar x10ba commented on May 12, 2024

Hi,
That makes sense, however, I get the same result if I insert the object into a DB (in this case mongo).

// I tried inserting both with and without the transform and get the same result.
{decodedMessage: '"firstAVSC {\n ...}}

Hmmm. Probably not an AVSC issue?

Thanks for your help.
x10ba

from avsc.

mtth avatar mtth commented on May 12, 2024

I'm not familiar with Mongo, but yes - this appears to be an issue with how you insert the data. It looks like util.inspect is getting called on the object returned by fromBuffer.

from avsc.

x10ba avatar x10ba commented on May 12, 2024

Hi.
Yep.
Source code on the initial side had util.inspect as part of the string and was sending that across to me (I wasn't expecting it).
AVSC did exactly as it should and decoded what it received.
As always, nothing but praise for you and your module.
Thanks,
x10ba

from avsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.