Skip to content

Commit

Permalink
docs(csv-parse): skip_lines_with_empty_values sample
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Nov 6, 2021
1 parent 2d4a326 commit 4ec9e58
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/csv-parse/samples/option.skip_lines_with_empty_values.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import assert from 'assert';
import { parse } from 'csv-parse';

parse(`
a,b,c
, ,\t
d,e,f
`.trim(), {
skip_lines_with_empty_values: true
}, (err, records) => {
assert.deepStrictEqual(records, [
['a', 'b', 'c'],
['d', 'e', 'f']
]);
});

0 comments on commit 4ec9e58

Please sign in to comment.