danielgindi / node-csv-reader

A CSV stream reader, with many many features, and ability to work with the largest datasets
MIT License
35 stars 11 forks source link

Can not use fs anymore. #21

Closed ramwin closed 3 years ago

ramwin commented 3 years ago

When I tried the example first

const Fs = require('fs');
const CsvReadableStream = require('csv-reader');

let inputStream = Fs.createReadStream('my_data.csv', 'utf8');

inputStream
    .pipe(new CsvReadableStream({ parseNumbers: true, parseBooleans: true, trim: true }))
    .on('data', function (row) {
        console.log('A row arrived: ', row);
    })
    .on('end', function (data) {
        console.log('No more rows!');
    });

An error occured. I find the problem is about the fs package. The link shows that:

This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.

I can't use or test this package further after this stuck.

Can anyone update the documentation or tell me how to solve it?

danielgindi commented 3 years ago

You probably tried to npm install fs, but fs is part of nodejs. Do not try to install it.