
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
context-url-extractor
Advanced tools
Methods for extracting URLs from HTML or text strings with surrounding context
Methods for extracting URLs from HTML or text strings with surrounding context
When data mining content that contains URLs, it's far easier for a machine to categorise them if they are semantic (or friendly) URLs:
This package provides a jumping off point for data mining the surrounding context of each URL found in the supplied content.
npm install --save context-url-extractor
const extractor = new ContextUrlExtractor({ content });
const res = extractor.extractUrls();
The default pre and post context string lengths are set to 170 characters, but this can be overridden in the constructor.
const extractor = new ContextUrlExtractor({ content, contextCharsBefore: 80, contextCharsAfter: 80 });
[
{
"url": "https://example.com/profile.aspx?section=99&trId=9877A4CF44987123AED90&rd=722108935",
"contextPre": "nd. To log in to your profile please <a href=\"",
"contextPost": "\">click here</a> and sign in with your email "
}
]
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2019 njhoran
FAQs
Methods for extracting URLs from HTML or text strings with surrounding context
We found that context-url-extractor 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.