The same scenario should go through, but the jongo45 solution doesn't seem to work anymore. Somehow I found a solution that worked for me. The wiring is lower, as this may help someone need it.
Below the code gets a list of all the files in the "lib / subdir" section.
const fileIO = require("sdk/io/file"); const fspath = require("sdk/fs/path"); const {Cc, Ci} = require("chrome"); const currDir = Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIDirectoryServiceProvider) .getFile("CurWorkD", {}).path; const listOfFiles = fileIO.list(fspath.resolve(currDir,'lib/subdir'));
source share