I need to run two commands in series that need to read data from the same stream. After piping a stream into another the buffer is emptied so i can't read data from that stream again so this doesn't work:  var spawn = require('child_pro...
I have looked at similar questions and answers and have not found an answer that directly addresses my question. I am struggling to understand how to use Maybe or Eitheror Monads in conjunction with piping functions. I want to pipe functions togeth...
I'm playing around with node streams and child processes. So I want to emulate next shell command with pipes:  ps au | grep ssh   So I wrote next code:  var spawn = require('child_process').spawn; var ps    = spawn('ps',   ['a...
I'm trying to write two files and some more text to a response. The code below does however only return the first file and the "Thats all!" text.  var http = require('http'),     util = require('util'),     fs   = require(...
I have a javascript file that looks like this.  var val = "foo" console.log(val) //EVALMD-STDOUT-FILE-DELIMETER if (!val) var val = "bar" console.log(val) //EVALMD-STDOUT-FILE-DELIMETER console.log(val)   I can run it two ways.  node...
I'm trying to wrap my head around Node.js streams, not that I'm pretty new to JavaScript and node, the last languages I really got were Perl and PHP :-D  I've read the Buffer/Streams documentation @ nodejs.org, watched James Halliday @ LX...
I'm trying to download HTML/JSON data from a webserver (Node.js) and convert it to PDF on the client-side. I wish to do the processing on the user's browser so my server don't get overloaded with pdfs conversions.   It shouldn't be a...
I have a common pattern in my gulpfile.js:  var rev         = require('gulp-rev'); var buffer      = require('gulp-buffer');  gulp.src.some_stuff   .pipe(anotherStuff)   .pipe(buffer()) // this line & 4 lines down   .pipe(rev())...
I see how to pipe stuff together using Node.js streams, but how do you pipe multiple scripts together using the Unix |, given that some of these scripts can be async?  $ ./a.js | ./b.js   Example:  a.js (chmod 0755)  #!/usr/bin/env node  setTimeout(f...
I am trying to implement a solution where by using PhantomJS a web location is open evaluated and the output is saved to a file for processing. Specifically the scanning for malicious scripts. I have been able to implement the solution using PhantomJ...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.