Skip to content

intesso/relative-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

relative-path

returns the absolute path for a given relative path

it's just a tiny helper function:

function getAbsolutePath() {
  var dir = path.dirname(module.parent.filename);
  var pathArgs = [dir].concat(Array.prototype.splice.call(arguments, 0));
  return path.join.apply(path, pathArgs);
};

install

npm install --save relative-path

use

var p = require('relative-path');

// will return the resolved absolute path.
p('./views/login.ejs');

// or
p('./views', 'login.ejs')

license

MIT

About

returns the absolute path for a given relative path

Resources

License

Stars

Watchers

Forks

Packages

No packages published