
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
safe-url-input-checker
Advanced tools
Safe Url Input Checker is a node.js library to check url safety.
#Safe Url Input Checker
Safe Url Input Checker is a node.js library to check url safety.
#Dependencies
#API
for some methods you can use callback or not. Just few methods require a callback especially.
var urlChecker = require('safe-url-input-checker')
checkUrlSafety
var options = {};
options.blacklist = [
'joker.com',
'slade.io',
'twoface.net',
'...',
'magneto.vilain'
];
options.protocolScheme = [
'http',
'https',
'ftp'
];
urlChecker.checkUrlSafety('localhost', function(err, res) {
console.log(res); // false
});
urlChecker.checkUrlSafety('http://batman.com', function(err, res) {
console.log(res); // true
});
urlChecker.checkUrlSafety('http://joker.com', function(err, res) {
console.log(res); // false
}, options);
urlChecker.checkUrlSafety('w3.com', function(err, res) {
console.log(res); // true
}, options);
getIPAddresses (optional callback)
urlChecker.getIPAddresses('localhost', function(err, res) {
if(err) throw err;
console.log(res); // ['127.0.0.1']
});
isAddressLocal (optional callback)
urlChecker.isAddressLocal('127.0.0.1', function(err, res) {
if(err) throw err;
console.log(res) // true
});
isHostLocal (requested callback)
urlChecker.isHostLocal('google.com', function(err, res) {
if(err) throw err;
console.log(res) // false
});
isHostBlacklisted (optional callback)
var blacklist = [
'joker.com',
'slade.io',
'twoface.net',
'...',
'magneto.vilain'
];
urlChecker.isHostBlacklisted('joker.com', blacklist, function(err, res) {
console.log(res); // true
});
isProtocolAcceptable (optional callback)
var protocolScheme = [
'http',
'https',
'ftp'
];
urlChecker.isProtocolAcceptable('http', protocolScheme, function(err, res) {
console.log(res); // true
});
resolveAndParseUrl (optional callback)
urlChecker.resolveAndParseUrl('google.com', function(err, res) {
console.log(res) // url object
});
#Licence
Copyright (c) 2014 Guillaume Baudusseau
MIT
FAQs
Safe Url Input Checker is a node.js library to check url safety.
The npm package safe-url-input-checker receives a total of 1 weekly downloads. As such, safe-url-input-checker popularity was classified as not popular.
We found that safe-url-input-checker 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.