Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (17 sloc) 492 Bytes
#! /usr/bin/env node
var Hook = require('hook.io').Hook,
Levenshtein = require('levenshtein');
var levenshtein = new Hook( {
name: 'levenshtein'
});
levenshtein.connect({
port: 5000,
host: "localhost"
});
levenshtein.on('ready', function(){
levenshtein.once('in.getDistance', function (event1, event2, data){
var lev = new Levenshtein(data.stringOne, data.stringTwo);
levenshtein.emit('out.getDistanceResponse', lev.distance);
console.log(lev.distance);
});
});