Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A profanity detector.
var Profane = require("profane");
var p = new Profane();
// get the set of all inappropriate words in a string (case insensitive and includes partial matches by default)
var wordCounts = p.getWordCounts("hell no dude");
console.log(wordCounts);
/*
{
'hell': 1,
'dude': 1,
}
*/
// get an associative array of all of categories found,
// where the key is the category and the value is the number
// of words found for that category
var categoryCounts = p.getCategoryCounts("hell no dude");
console.log(categoryCounts);
/*
{
'inappropriate': 1,
'informal': 1,
'religious': 1,
}
*/
p.addWord("nasty", ["inappropriate", "gross"]);
wordCounts = p.getWordCounts("you are nasty");
console.log(wordCounts);
/*
{
'nasty': 1,
}
*/
if (p.wordHasCategory("nasty", "gross")) {
console.log("This will be printed");
}
p.removeWord("nasty");
if (p.hasWord("nasty")) {
console.log("This won't be printed");
}
p.clearWords();
if (p.hasWord("hell")) {
console.log("This won't be printed");
}
p.addWord("hell", ["religious"]);
p.addCategoriesForWord("hell", ["inappropriate"]);
p.removeCategoriesForWord("hell", ["religious"]);
p.setCategoriesForWord("hell", ["inappropriate", "religious"]);
/*
get word counts without partial matching by using whole word matching
*/
p.setUseWholeWordMatch(true);
var wordCounts = p.getWordCounts("shell no dude hellhell hello");
console.log(wordCounts);
/*
{
'dude': 1,
}
*/
var wordCounts = p.getWordCounts("shell no dude hellhell hello HELL");
console.log(wordCounts);
/*
{
'hell': 1,
'dude': 1,
}
*/
FAQs
A profanity detector.
The npm package profane receives a total of 3 weekly downloads. As such, profane popularity was classified as not popular.
We found that profane 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.