diff --git a/package.json b/package.json index 442a864..c5c31ad 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "no-swears", "version": "1.2.1", - "description": "Filter swearwords out of your strings automagically", + "description": "Filter swearwords out of your strings automatically", "main": "index.js", "scripts": { "test": "node test.js" @@ -23,5 +23,8 @@ "bugs": { "url": "https://github.com/gmemstr/no-swears/issues" }, - "homepage": "https://github.com/gmemstr/no-swears#readme" + "homepage": "https://github.com/gmemstr/no-swears#readme", + "dependencies": { + "request": "^2.88.0" + } } diff --git a/swearList.js b/swearList.js index 4f05522..763987e 100644 --- a/swearList.js +++ b/swearList.js @@ -1,8 +1,14 @@ const fs = require('fs'); +const request = require('request'); const path = require('path'); const swearWordResource = path.join(__dirname, 'swearwords.txt'); module.exports = { + getRemoteList: (url, callback) => { + request.get(url, function (err, response, body) { + callback(formatSwearWordList(body)) + }); + }, getList: (callback) => { fs.readFile(swearWordResource, 'utf8', (err, wordList) => { if (err) {