bigint-conversion
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.1 • Public • Published

    License: MIT JavaScript Style Guide Node.js CI Coverage Status

    bigint-conversion

    Convert to/from non-negative integers represented with ES-2020 native JS implementation of BigInt from/to:

    • Buffer (node.js) or ArrayBuffer|TypedArray (native js),
    • hex string,
    • utf8-encoded text string,
    • standard and url-safe base64 with and without padding.

    It provides a common interface for the conversions that works for both node.js and native javascript.

    Note that there is not a directly visible TypedArray() constructor, but a set of typed array ones: Int8Array(), Uint8Array(), Uint8ClampedArray(), Int16Array(), Uint16Array(), Int32Array(), Uint32Array(), Float32Array(), Float64Array(), BigInt64Array(), BigUint64Array().

    Usage

    bigint-conversion can be imported to your project with npm:

    npm install bigint-conversion

    Then either require (Node.js CJS):

    const bigintConversion = require('bigint-conversion')

    or import (JavaScript ES module):

    import * as bigintConversion from 'bigint-conversion'

    The appropriate version for browser or node is automatically exported.

    BigInt is ES-2020. In order to use it with TypeScript you should set target (and probably also lib) to at least es2020 in tsconfig.json.

    You can also download the IIFE bundle, the ESM bundle or the UMD bundle and manually add it to your project, or, if you have already installed bigint-conversion in your project, just get the bundles from node_modules/bigint-conversion/dist/bundles/.

    API reference documentation

    Check the API

    Install

    npm i bigint-conversion

    DownloadsWeekly Downloads

    2,394

    Version

    2.2.1

    License

    MIT

    Unpacked Size

    84.7 kB

    Total Files

    15

    Last publish

    Collaborators

    • juanelasisme