- 檔案系統模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 系統模組
- PhantomJS - 屬性
- 網路伺服器模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 雜項
- 命令列介面
- PhantomJS - 螢幕捕獲
- PhantomJS - 頁面自動化
- PhantomJS - 網路監控
- PhantomJS - 測試
- PhantomJS - REPL
- PhantomJS - 示例
- PhantomJS 有用資源
- PhantomJS - 快速指南
- PhantomJS - 有用資源
- PhantomJS - 討論
PhantomJS - isFile
此方法檢查提供的檔案路徑是否為檔案。如果檔案路徑為檔案,則返回true;否則返回false。
語法
其語法如下所示 −
var fs = require('fs');
fs.isFile(filepath);
示例
下列示例展示了 isFile 方法的用法。
命令 − phantomjs isfile.js isfile.js
var fs = require('fs');
var system = require('system');
console.log(fs.isFile(system.args[1]));
phantom.exit();
以上程式生成以下輸出。
True
phantomjs_file_system_module_methods.htm
廣告