to-absolute-path

Transform any path to an absolute path depending on your call stack

Usage no npm install needed!

<script type="module">
  import toAbsolutePath from 'https://cdn.skypack.dev/to-absolute-path';
</script>

README

to-absolute-path Build StatusCoverage Status

Transform any path to an absolute path depending on your call stack

Install

$ npm install --save to-absolute-path

Usage

var toAbsolutePath = require('to-absolute-path');

toAbsolutePath('file.txt');
//=> c:/folder/subfolder/file.txt

API

toAbsolutePath(paths, [depth])

paths

Required
Type: Array, string

the path(s) to convert in to absolute one a path can be a negative path (starting with !)

depth

Type: int
Default: 0

Depth in the function call stack. ie: from which file/function the input paths are relative to

License

MIT © Thomas Sileghem