Code Monkey home page Code Monkey logo

Comments (11)

AckerApple avatar AckerApple commented on June 16, 2024 1

We have published code for this issue to become resolved. Please test and report back and/or close this issue.

Thank you in kind, in advanced

from jsonexport.

Roger13 avatar Roger13 commented on June 16, 2024 1

Unfortunatelly I went on a different direction and ended up using JSON.parse(JSON.stringify(data)) to convert all buffers to string. I wont be able to test this anywhere soon, but feel free to close this issue.

from jsonexport.

kaue avatar kaue commented on June 16, 2024

@Roger13 Maybe if you modify handleObject https://github.com/kauegimenes/jsonexport/blob/master/lib/parser/handler.js#L82
But currently this module does not support a custom object handler.

from jsonexport.

kaue avatar kaue commented on June 16, 2024
jsonexport(contacts, {
    handleObject: function(element, item, originalHandler){
        if (element instanceof Buffer) return [
            {item: element, 
            value: element.toString(),}
        ];
        return originalHandler(element, item);        
    }
}, function(err, csv){
    if(err) return console.log(err);
    console.log(csv);
});

Help wanted PR #49

from jsonexport.

kaue avatar kaue commented on June 16, 2024

@AckerApple What you think about this?
I think it's not nice to make the user return an array with item and value
also calling the originalHandler should be done by the module not the user.

from jsonexport.

AckerApple avatar AckerApple commented on June 16, 2024

really busy at the moment but @kauegimenes you know I love to pick apart code.

I will provide a response within maximum 48 hours

from jsonexport.

kaue avatar kaue commented on June 16, 2024

Thanks @AckerApple =) take your time!

from jsonexport.

Roger13 avatar Roger13 commented on June 16, 2024

I havent looked down this project source code yet, but since there isn't an 'handleObject' option yet, I could open a PR implementing it!

from jsonexport.

AckerApple avatar AckerApple commented on June 16, 2024

I put in some real time for this issue report which is now a feature request.

Please review #49 and my comments in it

@kauegimenes, I think it's going to be to your liking and our desired goal of simplicity. Merge if satisfied. Hit me up for more info

from jsonexport.

AckerApple avatar AckerApple commented on June 16, 2024

We will have a release for this relatively soon-isc. Most all work done

from jsonexport.

kaue avatar kaue commented on June 16, 2024

@Roger13 Please report back so we can close this issue.

from jsonexport.

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.