mirror of https://github.com/vitalif/phantomjs
commit
3a30ae0c14
|
@ -4,12 +4,21 @@ title: absolute
|
||||||
categories: api fs fs-method
|
categories: api fs fs-method
|
||||||
permalink: api/fs/method/absolute.html
|
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
|
## Examples
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var fs = require('fs');
|
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.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue