I have a .txt file that is space-delimited and it contains dupes. I want to remove the dupes but not finding it an easy task.
The file contains: orange orange apple apple pear
At first, I was getting an error with the txt extension. I updated the main to contain
const fs = require('fs');
require.extensions['.txt'] = function (module, filename) {
module.exports = fs.readFileSync(filename, 'utf8');
That helped with the errors and I was able to create a const
after that.
const fruitList = require('../support/fruitList.txt');
However, I am still unable to remove dupes. I tried neek
and that was not working either.