Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 52 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.