Join Path - Node.js File

Node.js examples for File:Path

Description

Join Path

Demo Code


function joinPath(){
  var output = [];
  output.append(arguments[0].rtrim("/"));
  for (var i = 1; i < arguments.length; i++) {
    var a = arguments[i];
    if (a !== undefined && a != null) {
      output.append(arguments[i].trim("/"))
    }//endif// ww w . java  2 s  . c  o  m
  }//for
  return output.join("/");
}//method

Related Tutorials