
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
to-exponential
Advanced tools
Converts any big/small/precise decimal number represented as String, to exponential notation.
Converts any arbitrarily big, small, or precise number represented as a String,
to exponential notation. For regular numbers it works just like JavaScript's
Number.toExponential()
.
The returned String can be used as a unique identifier for the number's value.
It accepts any decimal number represented as a String.
e...
) that does not fit in a 64-bit JS number.The exponent always gets a sign (+ or -), consistent with the output of
Number.toExponential()
. So e.g. 5 becomes '5e+0' (not '5e0').
Returns false
if the String does not represent a valid decimal number.
npm install to-exponential
const toExponential = require('to-exponential');
console.dir( toExponential('0.5') ); // => '5e-1'.
console.dir( toExponential('5') ); // => '5e+0'.
console.dir( toExponential('50') ); // => '5e+1'.
console.dir( toExponential('10.5') ); // Outputs '1.05e+1'.
console.dir( toExponential('0.105e2') ); // Outputs '1.05e+1' too.
console.dir( toExponential(
'-12324.3434716349863831487632112E-561640934731461387461933142'
) );
// => '-1.23243434716349863831487632112e-561640934731461387461933138'.
FAQs
Converts any big/small/precise decimal number represented as String, to exponential notation.
The npm package to-exponential receives a total of 605 weekly downloads. As such, to-exponential popularity was classified as not popular.
We found that to-exponential 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.