Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
is-reachable
Advanced tools
Readme
Check if servers are reachable
Works in Node.js and the browser (with a bundler).
The Node.js version will do a TCP handshake with the target's port. It attempts to detect cases where a router redirects the request to itself.
The browser version is limited by the fact that browsers cannot connect to arbitrary ports. It only supports HTTP and HTTPS and the check relies on the /favicon.ico
path being present.
$ npm install is-reachable
const isReachable = require('is-reachable');
(async () => {
console.log(await isReachable('sindresorhus.com'));
//=> true
console.log(await isReachable('google.com:443'));
//=> true
})();
Returns a Promise<boolean>
which is true
if any of the targets
are reachable.
Type: string | string[]
One or more targets to check. Can either be hostname:port
, a URL like https://hostname:port
or even just hostname
. port
must be specified if protocol is not http:
or https:
and defaults to 443
. Protocols other than http:
and https:
are not supported.
Type: object
Type: number
Default: 5000
Timeout in milliseconds after which a request is considered failed.
Node.js only
FAQs
Check if servers are reachable
The npm package is-reachable receives a total of 72,042 weekly downloads. As such, is-reachable popularity was classified as popular.
We found that is-reachable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.