Does csv-parse allow you to read from file?

I’m learning how to use the csv-parse module for nodejs. I wrote this code and it works perfectly:

var fs = require('fs');
const fileName="./spreadsheet.csv";
const assert = require('assert');
const { parse } = require('csv-parse');

const records = [];
// Initialize the parser
const parser = parse({
  delimiter: ','
// Use the readable stream api to consume records
parser.on('readable', function(){
  let record;
  while ((record = !== null) {
// Catch any error
parser.on('error', function(err){

fs.readFile(fileName, 'utf8', function (err, f) {
   if (err) {
      return console.error(err);
   const rows = f.split("rn");
   for(let x in rows) {


But right now, I depend on the fs module and fs.readFile to consume my csv file. Does the csv-parse have an option to read ffrom file? I ask because as you can see in my code, I ahve to specify my own line-break characters, which could differ between csv files. I thought maybe the csv-parse module would have something that can more readily address such a situation?


IN MongoDB Query

Realtime YOLO Monster Detection With Non Maximum Supression