raymondjavaxx / swearjar-node

Profanity detection and filtering library.
MIT License
73 stars 33 forks source link

loadBadWords loads relative to module directory (node node application directory) #3

Closed cucumbur closed 7 years ago

cucumbur commented 8 years ago

swearjar.loadBadWords loads a profanity dictionary relative to the modules path. Since this is only called once in the module itself and will generally be used as part of other programs, it seems counterintuitive to load relative to the module directory (given that node_modules aren't always tracked, could be cleaned and re-installed). I believe it would work more intuitively if it loaded the json relative to the calling file. I have already done this myself, so I could do a pull request https://github.com/cucumbur/swearjar-node/commit/808d14d1ba79d2caf696fff8b96912cee194c5fd

dnieh commented 8 years ago

I experienced this same exact issue. This is especially problematic when node_modules is in the .gitignore file and deployments are based solely on what's in package.json (very common in dev environments).