Files
nodejs-fm/processing.js
Christopher Rose d97803b70c Add travis,
add cover element
2019-05-23 08:40:01 +05:30

23 lines
642 B
JavaScript

const path = require('path')
module.exports.mergedir = (dirname,settings)=>{
return path.normalize(path.join(settings.dirname,dirname));
}
//produces the contents array
module.exports.dirprocess = (dirstream,location,settings)=>{
let contents = []
dirstream.forEach(element => {
//console.log(element)
if(!(element.name.startsWith('.')&&!settings.showHidden) )
{
contents.push({
"name":element.name,
"path":path.normalize(path.join(location,element.name)) ,
"isDir": element.isDirectory()
})
}
});
return contents
}