Version 1
[yaffs-website] / node_modules / phantomjs-prebuilt / lib / phantom / examples / arguments.js
diff --git a/node_modules/phantomjs-prebuilt/lib/phantom/examples/arguments.js b/node_modules/phantomjs-prebuilt/lib/phantom/examples/arguments.js
new file mode 100644 (file)
index 0000000..9c75974
--- /dev/null
@@ -0,0 +1,10 @@
+"use strict";
+var system = require('system');
+if (system.args.length === 1) {
+    console.log('Try to pass some args when invoking this script!');
+} else {
+    system.args.forEach(function (arg, i) {
+            console.log(i + ': ' + arg);
+    });
+}
+phantom.exit();