var unixify = require('{%= name %}');
unixify(filepath[, stripTrailingSlash]);
Strips leading drive letters and dot-slash (./
)
unixify('.\\one\\two\\three'); //=> 'one/two/three'
unixify('./one/two/three'); //=> 'one/two/three'
unixify('C:\\one\\two\\three'); //=> '/one/two/three'
unixify('\\one\\two\\three'); //=> '/one/two/three'
Normalizes path separators to forward slashes
unixify('one\\two\\three'); //=> 'one/two/three'
unixify('\\one\\two\\three'); //=> '/one/two/three'
unixify('C:\\one\\two\\three'); //=> '/one/two/three'
Combines multiple consecutive slashes
unixify('one//two//////three'), //=> 'one/two/three'
unixify('\\one\\two\\//three'); //=> '/one/two/three'
unixify('C:\\//one\\two\\//three'); //=> '/one/two/three'
Strips trailing slashes by default
unixify('one//two//////three//'), //=> 'one/two/three'
unixify('C:\\one\\two\\three\\'); //=> '/one/two/three'
Keep trailing slashes
By passing false
as the second argument
unixify('one//two//////three//'), //=> 'one/two/three/'
unixify('C:\\one\\two\\three\\'); //=> '/one/two/three/'