šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

is-redirect

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-redirect

Check if a number is a redirect HTTP status code

2.0.0
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
Ā 
Created

What is is-redirect?

The is-redirect npm package is a utility that helps determine if a given HTTP status code is a redirect status code. It is useful for handling HTTP responses and ensuring that your application can correctly identify and process redirects.

What are is-redirect's main functionalities?

Check if status code is a redirect

This feature allows you to check if a given HTTP status code is a redirect status code. In this example, the status code 302 is checked, and the output will confirm that it is a redirect status code.

const isRedirect = require('is-redirect');

const statusCode = 302;
if (isRedirect(statusCode)) {
  console.log('This is a redirect status code.');
} else {
  console.log('This is not a redirect status code.');
}

Other packages similar to is-redirect

Keywords

redirect

FAQs

Package last updated on 17 Apr 2021

Did you know?

Socket

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.

Install

Related posts