Socket
Socket
Sign inDemoInstall

has-cors

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-cors

Detects support for Cross-Origin Resource Sharing


Version published
Maintainers
1
Weekly downloads
1,660,481
decreased by-6.4%

Weekly downloads

Package description

What is has-cors?

The has-cors npm package is a simple utility to check if the browser or environment supports Cross-Origin Resource Sharing (CORS). It is primarily used in web development to determine if CORS is enabled in the user's environment, which is crucial for making cross-origin requests in web applications.

What are has-cors's main functionalities?

Check CORS support

This feature allows developers to programmatically check if the current browser or environment supports CORS. The package exports a boolean value indicating the presence of CORS support. This is useful for conditionally enabling or disabling functionality based on CORS availability.

var hasCORS = require('has-cors');

console.log(hasCORS); // Outputs: true or false

Other packages similar to has-cors

Readme

Source

has-cors

Detects support for Cross-Origin Resource Sharing

Installation

Install with component(1):

$ component install component/has-cors

API

Exports true if the user-agent supports CORS, or false otherwise.

var hasCORS = require('has-cors');
console.log(hasCORS);
// true

License

MIT

Keywords

FAQs

Last updated on 26 Jan 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc