
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
react-process-string
Advanced tools
The library allows you to process strings with regular expressions in ReactJS.
Via npm:
npm install react-process-string --save
processString(options)(string);
Options should be an array of objects containing regex and fn fields.
fn is a function that takes two arguments: key, to pass it to a react component and result — the result of regex executing.
const processString = require('react-process-string');
class HelloWorld extends React.Component {
render() {
let config = [{
regex: /(http|https):\/\/(\S+)\.([a-z]{2,}?)(.*?)( |\,|$|\.)/gim,
fn: (key, result) => <span key={key}>
<a target="_blank" href={`${result[1]}://${result[2]}.${result[3]}${result[4]}`}>{result[2]}.{result[3]}{result[4]}</a>{result[5]}
</span>
}, {
regex: /(\S+)\.([a-z]{2,}?)(.*?)( |\,|$|\.)/gim,
fn: (key, result) => <span key={key}>
<a target="_blank" href={`http://${result[1]}.${result[2]}${result[3]}`}>{result[1]}.{result[2]}{result[3]}</a>{result[4]}
</span>
}];
let stringWithLinks = "Watch this on youtube.com";
let processed = processString(config)(stringWithLinks);
return (
<div>Hello world! {processed}</div>
);
}
}
On the user side, processed will contain clickable links.
let users = ourStore.users;
let stringWithUsername = "Hello @efog, how do you feel today?";
let processed = processString([{
regex: /\@([a-z0-9_\-]+?)( |\,|$|\.)/gim, //regex to match a username
fn: (key, result) => {
let username = result[1];
let foundUsers = users.filter(user => user.username === username);
if (!foundUsers.length)
return result[0]; //@username
return <a key={key} href={`/user/${username}`}>@{username}</a>;
}
}]);
This code allows us to make @usernames clickable.
FAQs
A library to process strings with regular expressions.
The npm package react-process-string receives a total of 12,360 weekly downloads. As such, react-process-string popularity was classified as popular.
We found that react-process-string 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
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.