{"_id":"@2003scape/rsc-censor","_rev":"1-d3c0e5d854d072e71e947e40b48ff6f8","name":"@2003scape/rsc-censor","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@2003scape/rsc-censor","version":"1.0.0","description":"runescape classic chat censor and cache modification","main":"./src/index.js","bin":{"rsc-censor":"./src/bin.js"},"repository":{"type":"git","url":"git+https://github.com/2003scape/rsc-censor.git"},"keywords":["runescape","rsc","chat","censor","profanity","filter"],"author":{"name":"2003Scape Team"},"license":"AGPL-3.0+","bugs":{"url":"https://github.com/2003scape/rsc-censor/issues"},"homepage":"https://github.com/2003scape/rsc-censor#readme","dependencies":{"@2003scape/rsc-archiver":"^1.1.0","mkdirp-promise":"^5.0.1"},"gitHead":"030c1433cbbc42ef50b187b92f1564a625ee83c1","_id":"@2003scape/rsc-censor@1.0.0","_nodeVersion":"11.15.0","_npmVersion":"6.7.0","_npmUser":{"name":"misterhat","email":"misterhat144@gmail.com"},"maintainers":[{"name":"misterhat","email":"misterhat144@gmail.com"}],"dist":{"integrity":"sha512-ypIWd19qkf1UdaaB7lK9lLUjatNvWwzzG8VF9hyXo5+HD/H6d3fAqEStrO1Uj0dMHfRddRB4o8gQJSEU1dfEUw==","shasum":"21489a8c690eb8940bf4bdfce33d0f17b8df5535","tarball":"https://registry.npmjs.org/@2003scape/rsc-censor/-/rsc-censor-1.0.0.tgz","fileCount":12,"unpackedSize":262596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBnSPCRA9TVsSAnZWagAA4GQP/1S3Bsf6WJj59YCNXrRB\nG46bDiWJ74pLioKVIoU3ki3OXmj6FajkIBvFcmExWwwjXFjSQvGMUuwmzT16\nTGeoTEURtVM1F9f+ndQ+YZGhkbuBCY2V9zNa2KyHDxrV8NfrWhmDc8CjwqoM\nzodd2fYD0jJYn2ny11qKUYj4Dk0xQiC/UeH8hsVQQJVb/pMENPSeMA+sLVo0\nH+1epbNpvoP4ZB0o7MIx+TyZLLXW3rmkuDThWQTgq3/syZyQTzQKbXTNIedW\nNmRURwgYl3OY6O5/VbeCNIsOyXnzSEEIrsm1k7zrTO4eHjOOb0WOJcSsghVQ\nHZLrp87QdWMcNvikXWi8+8phQcSWzhGb5ifSCmch0TFsfT2iGS7FPqKVjeYY\nT3YMdOKg+OU8eDEuFKg9L3lvNpW052vXu41WX26p7nqxdFcAoYc6VRllL+mq\nDEKsEVxaGjPr2ngbOK5K62MEK9mJS/x/UtE14MH0Pk8ksp4YjrH+3Fv8kv5B\nn8N0BI8vCXeevjamVpgpNBupV0XAXlisw9v+MZgtbRNcXO/ALgcV7GQwoPFD\nblGsIgz4mWwP+N+osvU3LVaQdOVcFp4exKtMfIT3Oc5vm5YhvXQfoSDPwKeJ\nt7607PrMx/CK/dMtreWRYiAX2qUG24yFscEW6lEWPeTWCAFqSofvPx1puASb\nY9uZ\r\n=Yzsy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgSnvTKwmBLRG7cC8gUmT1Tv54kjubh5y+qBcowQuNDQIhANz8zDDrMKZt4agjFLwQcjK/cagvOk2Myop8OK8D3yFZ"}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rsc-censor_1.0.0_1577481358793_0.6415620369182176"},"_hasShrinkwrap":false}},"time":{"created":"2019-12-27T21:15:58.564Z","1.0.0":"2019-12-27T21:15:58.936Z","modified":"2022-04-04T10:34:53.904Z"},"maintainers":[{"name":"misterhat","email":"misterhat144@gmail.com"}],"description":"runescape classic chat censor and cache modification","homepage":"https://github.com/2003scape/rsc-censor#readme","keywords":["runescape","rsc","chat","censor","profanity","filter"],"repository":{"type":"git","url":"git+https://github.com/2003scape/rsc-censor.git"},"author":{"name":"2003Scape Team"},"bugs":{"url":"https://github.com/2003scape/rsc-censor/issues"},"license":"AGPL-3.0+","readme":"# rsc-censor\nrunescape classic chat censor and cache modification. this censor is\nsemi-intelligent and can detect similar looking symbols and spacing.\n\n## install\n\n    $ npm install @2003scape/rsc-censor # -g for CLI program\n\n## cli usage\n```\nrsc-censor <command>\n\nCommands:\n  rsc-censor censor <archive> <message>     censor message using filters in\n                                            archive\n  rsc-censor dump-json <archive>            dump JSON files of each censor\n                                            section\n  rsc-censor pack-json <archive> <files..>  encode and compress JSON files into\n                                            filter archive\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n```\n\n\t$ rsc-censor censor filter2.jag \"you suck\"\n\n## example\n```javascript\nconst Censor = require('./src');\nconst fs = require('fs');\n\nconst censor = new Censor();\ncensor.loadArchive(fs.readFileSync('./filter2.jag'));\n\nconsole.log(censor.censorMessage('hey you suck! visit dogs.com'))\n// hey you ****! visit ********\n\ncensor.badWords = censor.badWords.filter(({ word }) => !/suc/i.test(word));\ncensor.populateBuffers();\n\nconsole.log(censor.censorMessage('hey you suck! visit dogs.com'))\n// hey you suck! visit ********\n\nfs.writeFileSync('./filter3.jag', censor.toArchive());\n```\n\n## api\n### censor = new Censor()\ncreate a new censor instance.\n\n### censor.badWords\narray of profanities.\n\n```javascript\n[\n    {\n        word: 'breast',\n        // this allows \"abreast\" and \"breastplate\", but not \"breast\"\n        ignore: [\n            {\n                prefix: 'a',\n                postfix: null\n            },\n            {\n                prefix: null,\n                postfix: 'p'\n            }\n        ]\n    }\n]\n```\n\n### censor.hosts\narray of webiste [hostnames](https://en.wikipedia.org/wiki/Hostname).\n\n```javascript\n[\n    {\n        word: 'aol',\n        // allows for \"gaols\" but not \"go aol\"\n        ignore: [\n            {\n                prefix: 'g',\n                postfix: 's'\n            }\n            // ...\n        ]\n    }\n]\n```\n\n### censor.tlds\narray of [TLDs](https://en.wikipedia.org/wiki/Top-level_domain).\n\n```javascript\n[\n    {\n        word: 'com',\n        type: 3\n    }\n]\n```\n\n### censor.fragments\narray of word fragments. these seem to be used to fix the censor when it's\n[greedy](https://en.wikipedia.org/wiki/Regular_expression#Lazy_matching) and\nasterisks too many characters.\n\n### censor.loadArchive(buffer)\nload a filter jag archive buffer.\n\n### censor.populateBuffers()\napply changes to internal properties to the filter instance.\n\n### censor.censorMessage(message)\nreturn a censored string.\n\n### censor.toArchive()\nreturn a filter jag archive.\n\n## license\nCopyright 2019  2003Scape Team\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along\nwith this program. If not, see http://www.gnu.org/licenses/.\n","readmeFilename":"README.md"}