Merge pull request #12687 from joedf/patch-1

Add example for "fs.isAbsolute"
gh-pages
Ariya Hidayat 2014-11-16 10:59:49 -08:00
commit 70d85b3fc1
1 changed files with 9 additions and 1 deletions

View File

@ -9,7 +9,15 @@ permalink: api/fs/method/is-absolute.html
```javascript
var fs = require('fs');
// @TODO: Finish fs.isAbsolute example.
var path = '/Full/Path/To/test.txt';
// isAbsolute(path) returns true if the specified path is an absolute path.
if (fs.isAbsolute(path))
console.log('"'+path+'" is an absolute path.');
else
console.log('"'+path+'" is NOT an absolute path.');
phantom.exit();
```