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
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).
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