From a13cee1e4ac7e74e28c00c5ced6fa7e80ff99711 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 30 Jan 2015 21:31:42 +0000 Subject: [PATCH] 2000-01-01 Added explonation and code example --- _posts/api/fs/method/2000-01-01-absolute.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/_posts/api/fs/method/2000-01-01-absolute.md b/_posts/api/fs/method/2000-01-01-absolute.md index 08b5387e..5b642477 100644 --- a/_posts/api/fs/method/2000-01-01-absolute.md +++ b/_posts/api/fs/method/2000-01-01-absolute.md @@ -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. ```