Fzf: NodeJS repl support?

Created on 15 Sep 2016  路  3Comments  路  Source: junegunn/fzf

Is there an easy way to configure fzf to work inside the NodeJS repl? (or even the coffee-script repl?)

question

Most helpful comment

here's how I interact with fzf in node

var spawn = require('child_process').spawn;
var entries = ['things', 'I', 'want', 'to', 'search'].join('\n');

var fzf = spawn(`echo "${entries}" | fzf`, {
  stdio: ['inherit', 'pipe', 'inherit'],
  shell: true
});

fzf.stdout.setEncoding('utf-8');

fzf.stdout.on('readable', function() {
  var value = fzf.stdout.read();

  if (value !== null) {
    console.log(value);
  }
});

All 3 comments

I'm not a node.js guy, so I haven't tried it, but I did that with Ruby and Clojure REPL, so I suppose it should be possible in a similar way. See http://junegunn.kr/2016/02/using-fzf-in-your-program/

here's how I interact with fzf in node

var spawn = require('child_process').spawn;
var entries = ['things', 'I', 'want', 'to', 'search'].join('\n');

var fzf = spawn(`echo "${entries}" | fzf`, {
  stdio: ['inherit', 'pipe', 'inherit'],
  shell: true
});

fzf.stdout.setEncoding('utf-8');

fzf.stdout.on('readable', function() {
  var value = fzf.stdout.read();

  if (value !== null) {
    console.log(value);
  }
});

@kswilster Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jan-warchol picture jan-warchol  路  3Comments

fenuks picture fenuks  路  3Comments

nordlow picture nordlow  路  3Comments

erusev picture erusev  路  3Comments

sandric picture sandric  路  3Comments