Joins and normalizes a file path into a unix path.
Using the node
path.join() on Windows results in a backslash path separator. Using it on OSX or Linux uses a forward slash. This function is a wrapper that will perform the node join and then normalize all path separators using the forward slash. e.g. the path:
OSX/Linux paths will work the same. This function will also detect the "home" path leader (
~) and expand it.
This module uses yarn to manage dependencies and run scripts for development.
To install as an application dependency:
$ yarn add --dev util.join
To build the app and run all tests:
$ yarn run all
const join = require('util.join'); let s = join('C:\\', 'blah', 'blah', 'blah'); console.log(s); // prints the path 'C:/blah/blah/blah'