Skip to content

Commit

Permalink
fix: Merge pull request #304 from pelias/nodejs8-hack
Browse files Browse the repository at this point in the history
Add support for Node.js 8
  • Loading branch information
orangejulius authored Oct 30, 2017
2 parents f987ed2 + 3cf5e97 commit 94e0b3f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ notifications:
node_js:
- 4
- 6
- 8
matrix:
fast_finish: true
env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pelias-whosonfirst is a tool used for importing [Who's On First data](https://wh

## Requirements

Node.js 4 or 6 (the latest in the 4 series is currently recommended).
Node.js 4, 6, or 8 (the latest in the 4 series is currently recommended).

## Types

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pelias-whosonfirst",
"version": "0.0.0-semantic-release",
"engines": {
"node": ">=4.0.0 <8.0.0"
"node": ">=4.0.0"
},
"description": "Importer for Who's on First",
"main": "index.js",
Expand Down
10 changes: 8 additions & 2 deletions src/components/parseMetaFiles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const parse = require('csv-stream');
const csv_stream = require('csv-stream');
const EOL = require('os').EOL;

// this CSV parser assumes that:
Expand All @@ -12,5 +12,11 @@ const options = {
};

module.exports.create = function create() {
return parse.createStream(options);
const csv_parse_stream = csv_stream.createStream(options);

// override default encoding which is not set properly for Node.js 8
// see https://github.com/lbdremy/node-csv-stream/issues/13
csv_parse_stream._encoding = undefined;

return csv_parse_stream;
};

0 comments on commit 94e0b3f

Please sign in to comment.