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
30M
decreased by-0.64%
Maintainers
1
Install size
16.9 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

Changelog

Source

v1.0.0 - 2019-08-10

Commits

  • [Tests] add .travis.yml 9730412
  • Initial commit 65f7c38
  • [Tests] add tests e374a78
  • readme 5d39092
  • npm init 1be2e3d
  • implementation b7bc812
  • [Tests] add linting 04533be
  • [meta] create FUNDING.yml cf824a7
  • Only apps should have lockfiles 64e8242

Readme

Source

has-bigints Version Badge

Build Status 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 11 Aug 2019

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