Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyang committed Jun 20, 2017
1 parent 260424e commit 7aa77ba
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,27 @@ csv({

Above example will convert `birthday` column into a js `Date` object.

the returned value will be used in result JSON object. returning `undefined` will not change result JSON object. You can do following:

```js
/*csv data
user.name, birthday
Joe, 1970-01-01
*/
csv({
colParser:{
"user.name":function(item, head, resultRow, row , colIdx){
resultRow[head]=item;
}
}
})

```

without the parser the json is like {user:{name:Joe}}, with the parser the json is like {"user.name":Joe}



# Contribution

`csvtojson` follows github convention for contributions. Here are some steps:
Expand Down

0 comments on commit 7aa77ba

Please sign in to comment.