X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fphantomjs-prebuilt%2Flib%2Fphantom%2Fexamples%2Fstdin-stdout-stderr.js;fp=node_modules%2Fphantomjs-prebuilt%2Flib%2Fphantom%2Fexamples%2Fstdin-stdout-stderr.js;h=4161ba3b2337f84e0a6523e17a2d3fc1ecf690b7;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/phantomjs-prebuilt/lib/phantom/examples/stdin-stdout-stderr.js b/node_modules/phantomjs-prebuilt/lib/phantom/examples/stdin-stdout-stderr.js new file mode 100644 index 000000000..4161ba3b2 --- /dev/null +++ b/node_modules/phantomjs-prebuilt/lib/phantom/examples/stdin-stdout-stderr.js @@ -0,0 +1,19 @@ +"use strict"; +var system = require('system'); + +system.stdout.write('Hello, system.stdout.write!'); +system.stdout.writeLine('\nHello, system.stdout.writeLine!'); + +system.stderr.write('Hello, system.stderr.write!'); +system.stderr.writeLine('\nHello, system.stderr.writeLine!'); + +system.stdout.writeLine('system.stdin.readLine(): '); +var line = system.stdin.readLine(); +system.stdout.writeLine(JSON.stringify(line)); + +// This is essentially a `readAll` +system.stdout.writeLine('system.stdin.read(5): (ctrl+D to end)'); +var input = system.stdin.read(5); +system.stdout.writeLine(JSON.stringify(input)); + +phantom.exit(0);