Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Insafe is a Node.js package which resolves and checks that an URL is well-formed.
Insafe is a Node.js package which resolves and checks that an URL is well-formed.
w3.org
-> http://w3.org
npm install insafe
Insafe is a JavaScript Promise-based API.
It exposes a check(options)
function that returns a Promise. This Promise will resolve to an object containing:
String
Boolean
Array
or rejects with the unexpected errors the checker encountered when checking the URL
Example:
var insafe = require('insafe');
insafe.check({
url: 'example.com'
}).then(function (res) {
if(res.status == false) {
console.log('not valid url: ' +res.url);
} else {
console.log('The URL is valid.');
}
}).catch(console.log);
Several options are available to check the URL:
String
.Array
of accepted HTTP(S) status codes. See the default config.Array
of refused HTTP(S) status codes. See the default config.Array
of blacklisted hosts.Array
of whitelisted hosts.Example:
var insafe = require('insafe');
insafe.check({
url: 'http://www.w3.org/',
statusCodesAccepted: ["404"],
statusCodesRefused: ["301", "203"],
blacklist: ['h4ck3rz.org'],
whitelist: ['www.w3.org', 'example.com']
}).then(function (res) {
if(res.status == false) {
console.log('not valid url: ' +res.url);
} else {
console.log('The URL is valid.');
}
}).catch(console.log);
FAQs
Insafe is a Node.js package which resolves and checks that an URL is well-formed.
The npm package insafe receives a total of 29 weekly downloads. As such, insafe popularity was classified as not popular.
We found that insafe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.