# to-safe-integer-x

> ToSafeInteger converts 'argument' to an integral numeric value of safe limit.

Latest version **1.2.2** (published 2019-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-safe-integer-x
pnpm add to-safe-integer-x
yarn add to-safe-integer-x
bun add to-safe-integer-x
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2019-08-28 |
| First published | 2019-07-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.11.4 |
| Dependencies | 2 |
| Unpacked size | 235.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Graham Fairweather |
| Maintainers | xotic750 |
| Keywords | toSafeInteger, module, javascript, nodejs, browser |

## Links

- npm: https://www.npmjs.com/package/to-safe-integer-x
- Repository: https://github.com/Xotic750/to-safe-integer-x
- Issues: https://github.com/Xotic750/to-safe-integer-x/issues
- npm.io page: https://npm.io/package/to-safe-integer-x

## Dependencies (2)

- [math-clamp-x](https://npm.io/package/math-clamp-x.md) ^3.2.2
- [to-integer-x](https://npm.io/package/to-integer-x.md) ^4.2.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2019-08-28
- 1.2.1 — 2019-08-20
- 1.2.0 — 2019-08-14
- 1.1.0 — 2019-08-14
- 1.0.10 — 2019-07-31
- 1.0.9 — 2019-07-27
- 1.0.8 — 2019-07-27
- 1.0.7 — 2019-07-27
- 1.0.6 — 2019-07-26
- 1.0.5 — 2019-07-25
- 1.0.4 — 2019-07-24
- 1.0.3 — 2019-07-24
- 1.0.2 — 2019-07-24
- 1.0.1 — 2019-07-22

## README

<a
  href="https://travis-ci.org/Xotic750/to-safe-integer-x"
  title="Travis status">
<img
  src="https://travis-ci.org/Xotic750/to-safe-integer-x.svg?branch=master"
  alt="Travis status" height="18">
</a>
<a
  href="https://david-dm.org/Xotic750/to-safe-integer-x"
  title="Dependency status">
<img src="https://david-dm.org/Xotic750/to-safe-integer-x/status.svg"
  alt="Dependency status" height="18"/>
</a>
<a
  href="https://david-dm.org/Xotic750/to-safe-integer-x?type=dev"
  title="devDependency status">
<img src="https://david-dm.org/Xotic750/to-safe-integer-x/dev-status.svg"
  alt="devDependency status" height="18"/>
</a>
<a
  href="https://badge.fury.io/js/to-safe-integer-x"
  title="npm version">
<img src="https://badge.fury.io/js/to-safe-integer-x.svg"
  alt="npm version" height="18">
</a>
<a
  href="https://www.jsdelivr.com/package/npm/to-safe-integer-x"
  title="jsDelivr hits">
<img src="https://data.jsdelivr.com/v1/package/npm/to-safe-integer-x/badge?style=rounded"
  alt="jsDelivr hits" height="18">
</a>
<a
  href="https://bettercodehub.com/results/Xotic750/to-safe-integer-x"
  title="bettercodehub score">
<img src="https://bettercodehub.com/edge/badge/Xotic750/to-safe-integer-x?branch=master"
  alt="bettercodehub score" height="18">
</a>
<a
  href="https://coveralls.io/github/Xotic750/to-safe-integer-x?branch=master"
  title="Coverage Status">
<img src="https://coveralls.io/repos/github/Xotic750/to-safe-integer-x/badge.svg?branch=master"
  alt="Coverage Status" height="18">
</a>

<a name="module_to-safe-integer-x"></a>

## to-safe-integer-x

Constructs and returns a new string which contains the specified number of copies of the string.

<a name="exp_module_to-safe-integer-x--module.exports"></a>

### `module.exports` ⇒ <code>\*</code> ⏏

Converts `value` to a safe integer.

**Kind**: static property of [<code>to-safe-integer-x</code>](#module_to-safe-integer-x)  
**Returns**: <code>number</code> - Returns the converted integer.

| Param | Type            | Description           |
| ----- | --------------- | --------------------- |
| value | <code>\*</code> | The value to convert. |

**Example**

```js
import {toSafeInteger} from 'to-safe-integer-x';

console.log(toSafeInteger(3)); // 3
console.log(toSafeInteger(Number.MIN_VALUE)); // 0
console.log(toSafeInteger(Infinity)); // 9007199254740991
console.log(toSafeInteger(-Infinity)); // -9007199254740991
console.log(toSafeInteger('3')); // 3
```

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