
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
query-text-match
Advanced tools
Calculates the matching score between query and text
yarn add query-text-match
const _ = require('lodash');
const queryTextMatch = require('./index');
const query = "because I can't you";
const texts = [
'The stranger officiates the meal.',
'When transplanting seedlings, candied teapots will make the task easier.',
'His mind was blown that there was nothing in space except space itself.',
"Please put on these earmuffs because I can't you hear.",
'Flash photography is best used in full sunlight.',
'It dawned on her that others could make her happier, but only she could make herself happy.',
'He was the type of guy who liked Christmas lights on his house in the middle of July.',
"Art doesn't have to be intentional.",
'It was getting dark, and we weren’t there yet.',
'He learned the important lesson that a picnic at the beach on a windy day is a bad idea.',
];
const results = texts.map((text) => ({ ...queryTextMatch(query, text), text }));
console.log(_.sortBy(results, [
'unmatchedQueryWordsCount',
'extraCharactersCount',
'totalDistance'
]));
Outcome:
[
{
matchedQueryWordsCount: 3,
unmatchedQueryWordsCount: 1,
queryWordsCount: 4,
totalDistance: 6,
extraCharactersCount: 0,
takenWords: [[Object], [Object], [Object]],
queryNormalizedWordsList: ['because', 'i', 'cant', 'you'],
text: "Please put on these earmuffs because I can't you hear.",
},
{
matchedQueryWordsCount: 1,
unmatchedQueryWordsCount: 3,
queryWordsCount: 4,
totalDistance: 0,
extraCharactersCount: 0,
takenWords: [[Object]],
queryNormalizedWordsList: ['because', 'i', 'cant', 'you'],
text: 'His mind was blown that there was nothing in space except space itself.',
},
...
];
FAQs
Calculates the matching score between query and text
The npm package query-text-match receives a total of 1 weekly downloads. As such, query-text-match popularity was classified as not popular.
We found that query-text-match 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.