384686 (11) [Avatar] Offline
#1
As far as I can see, 3 of the functions in the listing(readFileStream, parseNumbers & writeFileStream) don't exist:

const dataForge = require('data-forge');
const inputFilePath = './data/weather-stations.csv';
const outputFilePath = './output/transformed.csv';
// … transformRow function omitted – it is the same as in listing 5
dataForge.readFileStream(inputFilePath) //#A
.parseCSV()
.parseNumbers(["MinTemp", "MaxTemp"])
.select(transformRow) //#B
.asCSV()
.writeFileStream(outputFilePath) //#C
.then(() => {
console.log(“Done”);
})
.catch(err => {
console.error(err);
});


I got it to write to the output file OK by substituting in readFileSync, parseInts & writeFileSync - but it throws an error when it reaches the then().
437073 (4) [Avatar] Offline
#2
This code listing was using a beta feature of Data-Forge. I've since removed the feature (I couldn't get it stable in time for the book) and I've removed the code listing.