tfidf = new TfIdf(); ! tfidf.addDocument('this document is about node.'); tfidf.addDocument('this document is about ruby.'); tfidf.addDocument('this document is about node. it has node examples'); ! tfidf.tfidfs('node', function(i, measure) { console.log('document #' + i + ' is ' + measure); }); // document #0 is 1.4469189829363254 // document #1 is 0 // document #3 is 2.8938379658726507