Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@typeforce/nan

Typeforce-JS4MIT1.0.0TypeScript support: included

A constant value representing NaN

constant, nan

readme

nan

NPM NPM CDN LICENSE

A constant value representing NaN (not-a-number).

Usage

    npm install @typeforce/nan --save   # Install package via NPM
    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 as demonstrated below.

    <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 for building, and Chai and Mocha for testing.

    npm install     # Installs dependencies.
    npm run build   # Build the project.
    npm test        # Run tests.

License

Refer to the LICENSE file for license information.