Skip to content

Commit

Permalink
feat(bom): strip byte-order-mark from CSV files (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink authored Nov 30, 2021
1 parent 3f9716c commit b8edafe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions lib/streams/recordStream.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
var fs = require( 'fs' );
var path = require( 'path' );

var csvParse = require( 'csv-parse' );
var combinedStream = require( 'combined-stream' );
var _ = require( 'lodash' );

var logger = require( 'pelias-logger' ).get( 'csv-importer' );
var DocumentStream = require('./documentStream');
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const csvParse = require('csv-parse').parse;
const combinedStream = require('combined-stream');
const logger = require('pelias-logger').get('csv-importer');
const DocumentStream = require('./documentStream');

/*
* Construct a suitable id prefix for a CSV file given
Expand Down Expand Up @@ -45,6 +43,7 @@ function createRecordStream( filePath, dirPath ){

var csvParser = csvParse({
trim: true,
bom: true,
skip_empty_lines: true,
relax_column_count: true,
relax: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@hapi/joi": "^16.0.0",
"async": "^3.0.1",
"combined-stream": "^1.0.7",
"csv-parse": "^4.0.1",
"csv-parse": "^5.0.3",
"fs-extra": "^8.0.0",
"glob": "^7.0.0",
"lodash": "^4.16.0",
Expand Down

0 comments on commit b8edafe

Please sign in to comment.