Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 21 lines (17 sloc) 0.492 kb
f7bc0da @AvianFlu [dist] Added bin script
authored
1 #! /usr/bin/env node
2 var Hook = require('hook.io').Hook,
3 Levenshtein = require('levenshtein');
4
5 var levenshtein = new Hook( {
6 name: 'levenshtein'
7 });
8
9 levenshtein.connect({
10 port: 5000,
11 host: "localhost"
12 });
13
14 levenshtein.on('ready', function(){
338b870 @AvianFlu [fix] Event fix
authored
15 levenshtein.once('in.getDistance', function (event1, event2, data){
16 var lev = new Levenshtein(data.stringOne, data.stringTwo);
17 levenshtein.emit('out.getDistanceResponse', lev.distance);
18 console.log(lev.distance);
f7bc0da @AvianFlu [dist] Added bin script
authored
19 });
20 });
Something went wrong with that request. Please try again.