Mongodb – How to allow to read only first 3 files from a directory in node.js
Below is the code const fs = require('fs'); const xml2js = require('xml2js'); const log = console.log; const path = require( "path" ); const folderPath = 'Data'; const folder = folderPath; let counter = 0; fs.readdirSync(folder).forEach(file => { const extname =…