Permalink
Browse files

update for node/npm

  • Loading branch information...
Glench committed Dec 27, 2012
1 parent 13056e5 commit 6457869e7c4fbd789c18eb837f1aa24bf7041323
Showing with 40 additions and 1 deletion.
  1. +5 −0 .npmignore
  2. +1 −0 index.js
  3. +16 −1 lib/fuzzyset.js
  4. +18 −0 package.json
@@ -0,0 +1,5 @@
.DS_Store
*.log
node_modules
build
*.node
@@ -0,0 +1 @@
module.exports = require('./lib/fuzzyset.js');
@@ -1,3 +1,5 @@
(function() {
var FuzzySet = function(arr, useLevenshtein, gramSizeLower, gramSizeUpper) {
var fuzzyset = {
version: '0.0.10'
@@ -146,7 +148,7 @@ var FuzzySet = function(arr, useLevenshtein, gramSizeLower, gramSizeUpper) {
return null;
}
var vectorNormal = Math.sqrt(sumOfSquareGramCounts),
var vectorNormal = Math.sqrt(sumOfSquareGramCounts),
results = [],
matchScore;
// build a results list of [score, str]
@@ -270,3 +272,16 @@ var FuzzySet = function(arr, useLevenshtein, gramSizeLower, gramSizeUpper) {
return fuzzyset;
};
var root = this;
// Export the fuzzyset object for **CommonJS**, with backwards-compatibility
// for the old `require()` API. If we're not in CommonJS, add `_` to the
// global object.
if (typeof module !== 'undefined' && module.exports) {
module.exports = FuzzySet;
root.FuzzySet = FuzzySet;
} else {
root.FuzzySet = FuzzySet;
}
})();
@@ -0,0 +1,18 @@
{
"name":"fuzzyset.js",
"description":"A fuzzy string set for JavaScript",
"version":"0.0.10",
"homepage":"http://github.com/Glench/fuzzyset.js",
"repository":"git://github.com/Glench/fuzzyset.js.git",
"author":"Glen Chiacchieri (http://glench.com/)",
"main":"./index.js",
"devDependencies":{
"should":"*"
},
"scripts":{
"test":""
},
"engines":{
"node":">= 0.4.0"
}
}

0 comments on commit 6457869

Please sign in to comment.