
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
int is an arbitrary size integer library written in javascript for node.js and browsers.
npm install int
var int = require('int');
var large = int('1234567890').mul('1234567890');
console.log(large.toString());
//'1524157875019052100'
// other cool stuff
var add_me = int('123456').add('-123456');
var power_up = int(2).pow(10);
Besides the int function, all of the other methods operate on the objects returned by int
construct a new aribtrary precision integer
valid values are native numbers, strings, or int objects. Anything after a decimal point will be discarded
add {value} to our number and return a new int
subtract {value} from our number and return a new int
multiply our int by {value} and return a new int
divide our int by {value} and return a new int (can truncate)
raise our int by {value} and return a new int
mod our int by {value} and return the new int
return a new int that is the negative
return a new int that is the absolute value
compare our value to {value}
return 0 if self and value are equal, -1 if self < value, 1 if self > value
return true if self < value
return true if self <= value
return true if self > value
return true if self >= value
return true if self == value
return true if self != value
FAQs
arbitrary precision integer and library in javascript
The npm package int receives a total of 7,149 weekly downloads. As such, int popularity was classified as popular.
We found that int demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.