# integer-limit

> Calculate the integer limit given the amount of bits used. (example: 32-bit limit).

Latest version **1.0.0** (published 2019-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install integer-limit
pnpm add integer-limit
yarn add integer-limit
bun add integer-limit
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-12-10 |
| First published | 2019-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7 |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Richie Bendall |
| Maintainers | richienb |

## Links

- npm: https://www.npmjs.com/package/integer-limit
- Repository: https://github.com/Richienb/integer-limit
- npm.io page: https://npm.io/package/integer-limit

## Dependencies (1)

- [arch](https://npm.io/package/arch.md) ^2.1.1

## Recent versions

- 1.0.0 (latest) — 2019-12-10

## README

# Integer limit [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/integer-limit/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/integer-limit)

Calculate the integer limit given the amount of bits used. (example: 32-bit limit).

[![NPM Badge](https://nodei.co/npm/integer-limit.png)](https://npmjs.com/package/integer-limit)

## Install

```sh
npm install integer-limit
```

## Usage

```js
const integerLimit = require("integer-limit");

integerLimit(); // Get current integer limit
9223372036854776000

integerLimit(32); // Get integer limit for 32 bits
//=> 2147483648

integerLimit(64); // Get integer limit for 64 bits
//=> 9223372036854776000

integerLimit(64, {bigint: true}); // Get integer limit 64 bits as a bigint
//=> 9223372036854775808n
```

## API

### integerLimit(bits?, options?)

#### bits

Type: `number`

The amount of bits allowed to be used in order to represent numbers.

#### options

Type: `object`

##### bigint

Type: `boolean`\
Default: `false`

Convert the amount of bits to a BigInt.

---
_Source: https://npm.io/package/integer-limit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
