
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
keywords-search
Advanced tools
Search keywords in a string and return a relevancy score.
npm i --save keywords-search
import search from 'keywords-search';
search( search: string, subject: string ): {
// Score of relevancy (between 0 and 100)
score: number,
// The minimum score you will get if at least each keyword is contained in the subject string
minAcceptableScore: number,
// The list of search string that have been matched
keywords: {
keyword: string,
score: number,
position: number
}[],
};
search("quality data analyst", "quality data analyst");
{
"keywords": [
{
"keyword": "data quality analyst",
"score": 9,
"position": 0
}
],
"score": 100,
"minAcceptableScore": 3,
}
search("data quality analyst", "quality data analyst");
{
"keywords": [
{
"keyword": "data",
"score": 0.6,
"position": 8
},
{
"keyword": "quality",
"score": 1,
"position": 0
},
{
"keyword": "analyst",
"score": 0.35,
"position": 13
}
],
"score": 21.67,
"minAcceptableScore": 3,
}
FAQs
Extract root domain name from an URL.
We found that keywords-search 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
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.