Socket
Socket
Sign inDemoInstall

has-bigints

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    has-bigints

Determine if the JS environment has BigInt support.


Version published
Weekly downloads
24M
decreased by-16.03%
Maintainers
1
Install size
13.3 kB
Created
Weekly downloads
 

Package description

What is has-bigints?

The has-bigints npm package is a simple utility that allows developers to check if the JavaScript environment they are working in supports BigInts. BigInts are a type of data in JavaScript that can represent whole numbers larger than 2^53 - 1, which is the largest number JavaScript can reliably represent with the Number primitive. This package is particularly useful for writing code that needs to be compatible with various JavaScript environments, including older browsers or JavaScript engines that do not support BigInts.

What are has-bigints's main functionalities?

Checking for BigInt support

This feature allows developers to programmatically check if the current JavaScript environment supports BigInts. The function returns a boolean value, true if BigInts are supported and false otherwise. This is useful for conditional code execution based on BigInt support.

const hasBigInts = require('has-bigints');

if (hasBigInts()) {
  console.log('This environment supports BigInts.');
} else {
  console.log('BigInts are not supported in this environment.');
}

Other packages similar to has-bigints

Readme

Source

has-bigints Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Determine if the JS environment has BigInt support.

Example

var hasBigInts = require('has-bigints');

hasBigInts() === true; // if the environment has native BigInt support. Not polyfillable, not forgeable.

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 19 Apr 2022

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