Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Make multiple changes to a block of text by providing start and end indices and replacement text
Make multiple changes to a block of text by providing start and end indices and replacement text
$ npm install --save patch-text
var patch = require('patch-text');
var text = 'Hello guys!'
var updated = patch(text, [
{
start: 0,
end: 5,
replacement: 'Hi'
},
{
start: 7,
end: 9,
replacement: 'al'
}
])
// => 'Hi gals!'
Your patches shouldn't overlap, but they can shrink or increase the character count and your patches will still apply to the right text.
patch(text, patches)
-> string
Required
Type: string
The text to patch.
Required
Type: array[object]
The patches to apply to the text, each with:
MIT © Ben Drucker
FAQs
Make multiple changes to a block of text by providing start and end indices and replacement text
We found that patch-text 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.