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.
react-anchorme
Advanced tools
React component using Anchorme.js to detect urls and emails in a text and converts them into clickable HTML links.
# npm
npm i react-anchorme
# Yarn
yarn add react-anchorme
Component takes string as a children, detects urls, emails, IP addresses in it and replaces them with clickable HTML links.
import React from 'react'
import { Anchorme } from 'react-anchorme'
const SomeComponent = () => {
return (
<Anchorme>Lorem ipsum http://example.loc dolor sit amet</Anchorme>
)
}
You can set custom anchor props that are applied to every link created by the component.
import React from 'react'
import { Anchorme } from 'react-anchorme'
const SomeComponent = () => {
return (
<Anchorme target="_blank" rel="noreferrer noopener">
Lorem ipsum http://example.loc dolor sit amet
</Anchorme>
)
}
You can truncate link text by setting up truncate
prop:
import React from 'react'
import { Anchorme } from 'react-anchorme'
const SomeComponent = () => {
return (
<Anchorme truncate={5}>
Lorem ipsum example.com dolor sit amet
</Anchorme>
)
}
You can set custom link component that is rendered instead of default anchor element.
import React from 'react'
import { Anchorme, LinkComponentProps } from 'react-anchorme'
const CustomLink = (props: LinkComponentProps) => {
return (
<i>
<a {...props} />
</i>
)
}
const SomeComponent = () => {
return (
<Anchorme linkComponent={CustomLink} target="_blank" rel="noreferrer noopener">
Lorem ipsum http://example.loc dolor sit amet
</Anchorme>
)
}
FAQs
React component to detect links in text and make them clickable
We found that react-anchorme 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.