New issue
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
Feature/super fields (for feature request #78) #79
Conversation
{ fields: [ // Support label -> simple path { label: 'some label', value: 'path.to.something' }, // Support label -> derived value { label: 'some label', // Supporting duplicate labels value: function(row) { return row.path1 + row.path2; } }, // Support pathname -> pathvalue (label optional, keeps backwards compatibility) 'simplepath' 'path.to.value' ] }
Also solves #71. Check https://github.com/azhang/json2csv/blob/feature/superFields/test/index.js#L318 for usage. |
I can merge once there is some documentation explaining this new feature 😄 |
Added! ^_^ Feel to make changes if you think something can be clearer. Also, does this require a major version update? Everything should be backwards compatible. |
I'm going to be doing a major bump any way, so this will make it into that. |
Feature/super fields (for feature request #78)
Woot! Thanks! |
Sure. Do you have enough rights to do it or shall i do it? @azhang What's your npm username? |
No, I don't have enough rights. |
Npm username is azhang. Thanks a lot! |
$ npm owner ls json2csv
azhang <azhang@bottlenose.com>
knownasilya <ilya@burstcreations.com>
zemirco <mirco.zeiss@gmail.com> done. also added you to Collaborators. |
#78
Allow params.fields to have more options. Supports
label
andpath
.path
can be a string path like before, or a function(row) to return a derived value.Should be mostly, if not completely, backwards compatible, as it passes all tests.