path.js
function targetPath(fromPath, basePath, targetDirectory) {
  // console.log('targetPath:fromPath: ' + fromPath);
  // console.log('targetPath:basePath: ' + basePath);
  // console.log('targetPath:targetDirectory: ' + targetDirectory);
  var relativePath = path.relative(basePath, fromPath);
  // console.log('targetPath:relativePath: ' + relativePath);
  // console.log('targetPath: ' + path.resolve(targetDirectory, relativePath));
  return path.resolve(targetDirectory, relativePath);
}
function targetPath(fromPath, basePath, targetDirectory) {
  // console.log('targetPath:fromPath: ' + fromPath);
  // console.log('targetPath:basePath: ' + basePath);
  // console.log('targetPath:targetDirectory: ' + targetDirectory);
  var relativePath = path.relative(basePath, fromPath);
  // console.log('targetPath:relativePath: ' + relativePath);
  // console.log('targetPath: ' + path.resolve(targetDirectory, relativePath));
  return path.resolve(targetDirectory, relativePath);
}
function targetPath ( fromPath , basePath , targetDirectory ) { // console.log('targetPath:fromPath: ' + fromPath); // console.log('targetPath:basePath: ' + basePath); // console.log('targetPath:targetDirectory: ' + targetDirectory); var relativePath = path . relative ( basePath , fromPath ) ; // console.log('targetPath:relativePath: ' + relativePath); // console.log('targetPath: ' + path.resolve(targetDirectory, relativePath)); return path . resolve ( targetDirectory , relativePath ) ; }
full path in targetDirectory
@param fromPath /User/XXXX/node_modules/module/index.js
@param basePath /User/XXXX/node_modules/
@param targetDirectory /User/XXXX/dist/npm/
@returns {*} /User/XXXX/dist/npm/module/index.js
full path in targetDirectory