@typeforce/nan
Version:
A constant value representing NaN
65 lines (47 loc) • 1.88 kB
Markdown
[license-shield-url]: https://img.shields.io/github/license/Typeforce-JS/nan.svg?style=flat-square
[license-url]: https://github.com/Typeforce-JS/nan/blob/master/LICENSE
[npm-downloads-shield-url]: https://img.shields.io/npm/dt/@typeforce/nan.svg?style=flat-square
[npm-version-shield-url]: https://img.shields.io/npm/v/@typeforce/nan.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@typeforce/nan
[unpkg-shield-url]: https://img.shields.io/badge/unpkg-up--to--date-brightgreen.svg?style=flat-square
[unpkg-url]: https://unpkg.com/@typeforce/nan/dist/index.min.js
# nan
[![NPM][npm-version-shield-url]][npm-url]
[![NPM][npm-downloads-shield-url]][npm-url]
[![CDN][unpkg-shield-url]][unpkg-url]
[![LICENSE][license-shield-url]][license-url]
A constant value representing NaN (not-a-number).
## Usage
```shell
npm install @typeforce/nan --save # Install package via NPM
```
```javascript
import { expect } from "chai";
import nan from "@typeforce/nan";
// The constant can be accessed directly:
expect(nan.nan).to.be.NaN;
// Or it can be calculated:
expect(nan.calculate()).to.be.NaN;
```
This package contains TypeScript type declarations.
### Content Delivery Network (CDN)
This package can be imported via [unpkg](https://unpkg.com/#/) as demonstrated
below.
```html
<script src="https://unpkg.com/@typeforce/nan/dist/index.min.js"></script>
<script type="application/javascript">
if (Number.isNaN(NAN)) {
// Yay!
}
</script>
```
## Build & Test
This package uses [Gulp](https://gulpjs.com/) for building, and [Chai](http://chaijs.com/)
and [Mocha](https://mochajs.org/) for testing.
```shell
npm install # Installs dependencies.
npm run build # Build the project.
npm test # Run tests.
```
## License
Refer to the `LICENSE` file for license information.