Join strings to form a valid path.
pppath(parts [, filename])
Returns a String, the result of joining
filename is appended to the returned path if the last element of
parts does not end with a file extension.
// without `filename`; //=> '/foo/bar'; //=> ''// with `filename`; //=> '/foo/bar/index.html'; //=> '/foo/bar/index.html'; //=> '/foo/bar.js'; //=> ''; //=> ''; //=> ''
/ will be replaced by a single
/, with the exception that the character sequence
:// will remain intact. This is not the behaviour of the Node API’s
// :(path; //=> 'http:/foo/bar'// :); //=> ''
More usage examples are in the tests.
Install via npm:
$ npm i --save pppath
- Initial release