Merge pull request #12924 from TechLiam/patch-1

2000-01-01
gh-pages
Ariya Hidayat 2015-01-31 10:51:55 -08:00
commit 3a30ae0c14
1 changed files with 10 additions and 1 deletions

View File

@ -4,12 +4,21 @@ title: absolute
categories: api fs fs-method
permalink: api/fs/method/absolute.html
---
'absolute(string)' (string)
Gets the absolute path to where the phantomjs is been run from.
If you use relitive addresses then you can get the actual address of directorys above and below the phantomjs program.
## Examples
```javascript
var fs = require('fs');
// @TODO: Finish fs.absolute example.
var res = fs.absolute("../");
console.log(res);
// This gives you the path of one directory up from the location in which the phantomjs is running.
var res = fs.absolute("/below");
console.log(res);
// This gives you the path of the below directory inside the location in which the phantomjs is running.
```