New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

brocabulary

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brocabulary - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

.npmignore

19

index.js
var fs = require('fs')
, dictFile = __dirname + '/data/dict';
, listenshtein = require('listenshtein');
var dictFile = __dirname + '/data/dict';
function rand(l) {
return Math.floor(Math.random()*l);
}
function brocabulary(cb) {

@@ -10,5 +16,14 @@ var self = {}

self.random = function() {
return dict[Math.floor(Math.random()*dict.length)];
return dict[rand(dict.length)];
};
self.broify = function(words) {
if(typeof words === 'string') words = words.split(' ');
for(var i = 0, l = words.length; i < l; i++) {
var match = listenshtein(words[i], dict, 3);
if(match) words[i] = match;
}
return words.join(' ');
};
cb = (cb || function() {});

@@ -15,0 +30,0 @@ s.on('end', function() { cb(self); });

7

package.json
{
"name": "brocabulary",
"version": "0.0.1",
"version": "0.1.0",
"description": "Expand your brocabulary",

@@ -11,3 +11,6 @@ "main": "index.js",

"author": "Drew Stokes",
"license": "BSD"
"license": "BSD",
"dependencies": {
"listenshtein": "0.0.0"
}
}

@@ -12,3 +12,5 @@ var assert = require('assert')

assert.ok(b.random().length);
console.log(b.broify('tuxedo'));
assert(b.broify('tuxedo') === 'Tuxedbro');
});
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc