An alternative to long.js with support for ESM, CJS, UMD and Modern Mode. It's written in TypeScript and thus houses it's own type declarations.
long-ts and long.js differences:
Long.isLong() in favor of using instanceof.eq and shr and more.import { Long } from 'long-ts' instead of const Long = require('long.js')npm install long-ts
import { Long } from "long-ts";
const longVal = new Long(0xffffffff, 0x7fffffff);
console.log(longVal.toString());
https://hornta.github.io/long-ts/modules.html
npm run build will also build the documentation in /docs
npm install
npm run build
Running tests:
npm run test
Running linter:
npm run lint
Generated using TypeDoc