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

Commit

Permalink
doc: example for ignore_last_delimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jan 18, 2021
1 parent 4d70b33 commit 9ec1b56
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions samples/option.ignore_last_delimiters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

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

parse(`
format,description
CSV,CSV delimited text file that uses a comma, by default, to separate values.
SSA,SSA is a subtitle file format that allows for more advanced subtitles than the conventional SRT and similar formats.
ASS,Advanced SubStation Alpha (ASS), technically SSA v4+, is a script for more advanced subtitles than SSA.
`.trim(), {
columns: true,
ignore_last_delimiters: 10
}, function(err, records){
assert.deepEqual(records, [{
format: 'CSV',
description: 'CSV delimited text file that uses a comma, by default, to separate values.'
},{
format: 'SSA',
description: 'SSA is a subtitle file format that allows for more advanced subtitles than the conventional SRT and similar formats.'
},{
format: 'ASS',
description: 'Advanced SubStation Alpha (ASS), technically SSA v4+, is a script for more advanced subtitles than SSA.'
}
])
})

0 comments on commit 9ec1b56

Please sign in to comment.