Große Bibliothek zum Parsen von CSV-Dateien!Knoten csvtojson. Wo ist das Ergebnis?
Schnelle Frage: wo ist das Ergebnis JSON nach dem Parsen einer CSV-Datei gespeichert? Das Tutorial bei https://www.npmjs.com/package/csvtojson#library hat dieses Beispiel:
const csvFilePath='<path to csv file>'
const csv=require('csvtojson')
csv()
.fromFile(csvFilePath)
.on('json',(jsonObj)=>{
// combine csv header row and csv line to a json object
// jsonObj.a ==> 1 or 4
})
.on('done',(error)=>{
console.log('end')
})
Aber, sobald 'done' heißt ... wo ist mein Ergebnis json ?!
Ich habe das Objekt im Debugger untersucht und kann das Ergebnis nicht finden.
Vielen Dank im Voraus
Hum, wusste nicht vonFile hatte einen Rückruf, als es fertig war ... sah es nicht in der Dokumentation. Vielen Dank! – Nacho
Ja .. Die Dokumentation ist irreführend .. –