Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Weekly downloads
2.4M
increased by6.6%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc