
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
Sum numbers
npm install math-sum
import sum from 'math-sum';
sum(5, 5);
//=> 10
sum([1, 2, 3, 4]);
//=> 10
import sum from 'math-sum';
sum.bigInt(5, 5);
//=> 10n
sum.bigInt([1, 2, 3, 4]);
//=> 10n
sum.bigInt(1, 2n, 3);
//=> 6n
const largeNumber = 9_007_199_254_740_993n; // Number.MAX_SAFE_INTEGER + 2
sum.bigInt(largeNumber, largeNumber);
//=> 18_014_398_509_481_986n
The sum.bigInt() method accepts both regular numbers and BigInts and always returns a BigInt. Regular numbers are converted to BigInts automatically. This is useful when you need to sum numbers that exceed JavaScript's safe integer range.
[!NOTE] The method throws a
RangeErrorif any value is a non-integer number (e.g.,3.14).
FAQs
Sum numbers
We found that math-sum demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.