
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
good-censor
Advanced tools
A simple censoring module for all your needs.
npm i --save good-censor
const GoodCensor = require('good-censor');
const badwords = [
'duck',
'ship',
'sax',
'nagger',
'corn',
'sick',
'batch',
'clip',
'milk',
]
const myCensor = new GoodCensor(badwords)
const censored = myCensor.censor('duck you, you little batch');
console.log(censored) // "**** you, you little *****"
// the following are the default values
const options = {
censorText: '*',
censorLoop: true,
censorLongest: true,
censorSlice: true,
censorStart: 0,
censorEnd: 0,
ignore: /(?!)/
}
myCensor.censor('someString',options);
Note: examples below are pseudocode |
---|
options = {
censorText: '#',
}
// result: #### you, you little #####
options = {
censorText: '~BEEP~',
censorSlice: false,
censorLoop: false,
}
// result: ~BEEP~ you, you little ~BEEP~
options = {
censorText: '#',
censorLoop: false,
}
// result: # you, you little #
options = {
censorText: 'NO',
censorLoop: true,
censorSlice: false,
}
// result: NONO you, you little NONONO
badwords = ['duck','ducking']
text = 'ducking'
options = {
censorLongest: true,
}
// result: *******
badwords = ['duck','ducking']
text = 'ducking'
options = {
censorLongest: false,
}
// result: ****ing
options = {
censorText: 'AAAAAAAAAA',
censorSlice: true,
}
// result: AAAA you, you little AAAAA
options = {
censorText: 'AAAAAAAAAA',
censorSlice: false,
}
// result: AAAAAAAAAA you, you little AAAAAAAAAA
options = {
censorStart: 1,
}
// result: d*** you, you little b****
options = {
censorStart: 2,
}
// result: du** you, you little ba***
NOTE: if you put a number which is too big (especially in combination with options.censorEnd
), the full word may get not censored.
options = {
censorEnd: 1,
}
// result: ***k you, you little ****h
options = {
censorEnd: 2,
}
// result: **ck you, you little ***ch
NOTE: if you put a number which is too big (especially in combination with options.censorStart
), the full word may get not censored.
options = {
ignore: /ck|ch/
}
// result: duck you, you little batch
NOTE: this is really useful in cases where you don't want to censure URLs or other specific strings. The flags will be forced to be iy
FAQs
A simple text censoring module.
The npm package good-censor receives a total of 0 weekly downloads. As such, good-censor popularity was classified as not popular.
We found that good-censor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.