Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Replace relative URLs in a string with absolute URLs. This library is extremely small and lightweight, and requires no external dependencies.
The primary motivation of this library is to be concise and performant, when
searching for this functionality, the common solution is to use actual DOM
manipulation for finding and replacing URLs, using jQuery
, cheerio
, and/or jsdom
.
npm install absolutify
var absolutify = require('absolutify')
var html = '<html><a href="/sorensen">Home</a></html>'
var site = 'https://github.com'
var parsed = absolutify(html, site)
// '<html><a href="https://github.com/sorensen">Home</a></html>'
var byFunction = absolutify(html, function(url, attrName) {
// url === '/sorensen'
// attr === 'href'
return site + url
})
This library searches a given HTML string for the following attribute values that
start with either /
or any form of ../
pathing.
Attribute |
---|
href |
src |
codebase |
cite |
background |
action |
profile |
formaction |
icon |
manifest |
archive |
FAQs
Relative to Absolute URL Replacer
The npm package absolutify receives a total of 321 weekly downloads. As such, absolutify popularity was classified as not popular.
We found that absolutify 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.