file path utils for the browser and node.js