- 檔案系統模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 系統模組
- PhantomJS - 屬性
- 網路伺服器模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 其他
- 命令列介面
- PhantomJS - 螢幕截圖
- PhantomJS - 頁面自動化
- PhantomJS - 網路監控
- PhantomJS - 測試
- PhantomJS - REPL
- PhantomJS - 使用示例
- PhantomJS 實用資源
- PhantomJS - 快速指南
- PhantomJS - 實用資源
- PhantomJS - 討論
PhantomJS - makeDirectory
該方法建立一個新目錄。
語法
語法如下 −
var fs = require('fs');
fs.makeDirectory(path);
示例
命令 − phantomjs makedirectory.js newfiles
var fs = require('fs');
var system = require('system');
var path = system.args[1];
var md = fs.makeDirectory(path);
console.log(fs.isDirectory(path));
phantom.exit();
上述程式生成以下輸出。
True
phantomjs_file_system_module_methods.htm
廣告