Here I am putting the file names in to filename.txt, but I am not getting how to compare with existing file in the filename.txt
const yargs = require('yargs')
const fs = require('fs')
const command = process.argv[2]; // I am giving in terminal like nodejs app.js file1.txt//
var argv = fs.appendFile('filename.txt', command, (err) => {
if (err) throw err;
console.log('The files were updated!');
console.log(argv)
});
The contents in text file will be filename ,my question is how to take and compare with new filename(whether they are matching or not )