Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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 65 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.