This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: example for ignore_last_delimiters
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.' | ||
} | ||
]) | ||
}) |