https://github.com/mastilver/to-absolute-path
Transform any path to an absolute path depending on your call stack
https://github.com/mastilver/to-absolute-path
Last synced: about 1 month ago
JSON representation
Transform any path to an absolute path depending on your call stack
- Host: GitHub
- URL: https://github.com/mastilver/to-absolute-path
- Owner: mastilver
- License: mit
- Created: 2015-08-24T13:43:28.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-12-23T13:03:17.000Z (over 9 years ago)
- Last Synced: 2025-02-22T12:16:05.977Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# to-absolute-path [](https://travis-ci.org/mastilver/to-absolute-path)[](https://coveralls.io/github/mastilver/to-absolute-path?branch=master)
> Transform any path to an absolute path depending on your call stack
## Install
```
$ npm install --save to-absolute-path
```
## Usage
```js
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](https://github.com/mastilver)