For Firefox:
var file = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("/home");
See https://developer.mozilla.org/en-US/docs/Code_snippets/File_I_O
For others, check out the TiddlyWiki app to see how it does it.