In my current Browserify project, I need the ability to scroll through folders of a specific directory and receive a json file from each. Therefore, I will need some kind of module fs.
Are there any specific modules that you can recommend to play well with Browserify and let me use readdirsync/ readdiror another method to read the contents of another directory?
Apparently, I cannot use the regular nodejs module fs, and I looked through brfs , but that only gives me access to readFile.
I would like to do something like:
getFiles = require('./getFiles.js')():
and
module.exports = function(){
var fs = require('some_module_system');
var folders = fs.readdir('../path/to/dir', function(err, contents){
console.log(contents);
});
}
and wrap everything with
browserify app.js > build.js