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:
- Removed
Long.isLong()
in favor of usinginstanceof
. - Removed all aliased shorthand methods like
eq
andshr
and more. - Using named export
import { Long } from 'long-ts'
instead ofconst 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