Piping input to a BufferedProcess


I’m trying to enhance the existing language-clojure plugin to spit out docs for the symbol under the cursor. To do this I’m using Clojure’s own machinery, which involves firing up a persistent REPL, issuing (doc foobar) commands to it and grabbing the output. Trouble is, I can’t seem to get an stdin pipe like I would with spawn.

Should it be possible to just pass

options: { stdio: ['pipe', null, null] }

to the BufferedProcess constructor? When I do this, the stdin property of the process object remains undefined.

How to send input (stdin) to BufferedProcess

Did you solve it? If so share it =). I would like to know how to pipe input as well. Thanks.


Looking at the source here, it should be working. Are you accessing the stdin like this :

bp = new BufferedProcess(command: 'command', options: {stdio: ['pipe', null, null]} )


bp = new BufferedProcess(command: 'command', options: {stdio: ['pipe', null, null]} )

I’m not too familiar with this particular NodeJS API but trying it in the console I can access the stdin property with the second example, the result of the spawn called being stored in process and, as far as I can tell, the class doesn’t delegates any methods of the process object.