Comments (11)
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.
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.
@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.
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.
@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.
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.
Thanks @AckerApple =) take your time!
from jsonexport.
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.
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.
We will have a release for this relatively soon-isc. Most all work done
from jsonexport.
@Roger13 Please report back so we can close this issue.
from jsonexport.
Related Issues (20)
- Stream does not support typeHandlers option HOT 3
- How to remove the title option from inside xls file
- Nested JSONObject not correctly mapping to csv
- Update v2.5.2 to v2.5.3 with Bug Fixes for package.json stuck on v2
- verticalOutput with Arrays HOT 1
- No option to ignore fields / limit fields to export ? HOT 2
- large files not converting HOT 10
- (I think I) found a bug HOT 6
- typeHandlers tests & more samples
- speed question/issue HOT 4
- Column values with zero (0) are being replaced with "" HOT 3
- Complex JSON array - unexpected behavior HOT 1
- Need Help : Complex Json Array to CSV HOT 2
- Json Complex Example HOT 2
- JSON Array not converting to CSV HOT 1
- TypeError: this._options.handleDate is not a function HOT 5
- Question. What is expected behaviour when exporting objects where some do not have all fields in header HOT 12
- typeHandlers is not part of UserOptions HOT 2
- CLI: Json Complex Object outputting all keys as headers HOT 11
- Exporting a dataset with a hashtag (#) in a string breaks CSV HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonexport.