Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
samples: new column script
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Sep 24, 2018
1 parent ef8c4d1 commit e92b407
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@

## Trunk

* samples: new column script
* samples: update syntax
package: improve ignore files

Expand Down
19 changes: 19 additions & 0 deletions samples/options.columns.js
@@ -0,0 +1,19 @@

const parse = require('../lib')
const assert = require('assert')

const records = parse(`
"key_1","key_2"
"value 1","value 2"
`, {
columns: true,
trim: true,
skip_empty_lines: true
}, function(err, records){
assert.deepEqual(
records, [{
key_1: 'value 1',
key_2: 'value 2'
}]
)
})

0 comments on commit e92b407

Please sign in to comment.