
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.
thousandify
Advanced tools
Currency thousand format
$ npm install thousandify
const thousandify = require('thousandify');
// 123456 -> '123,456'
console.log(thousandify(123456))
// 123456.1 -> '123,456.1'
console.log(thousandify(123456.1))
// 123456.123 -> '123,456.123'
console.log(thousandify(123456.123))
// 123456 -> '123,456.00'
console.log(thousandify(123456, { decimalDigits: 2 }))
// 123456.1-> '123,456.10'
console.log(thousandify(123456.1, { decimalDigits: 2 }))
// 123,456.123 -> '123,456.12'
console.log(thousandify(123456.123, { decimalDigits: 2 }))
// 123456 -> '123 456'
console.log(thousandify(123456, { thousandSeparator: ' ' }))
thousandify(currency, option)
currency
Required, <Number | BigInt | String>
option
Optional, the default value is:
{
thousandSeparator: ',',
decimalSeparator: '.',
decimalDigits: false
}
thousandSeparator
: <String>
The separator of thousands number string
decimalSeparator
: <String>
The decimal separator
decimalDigits
: <Number | Falsy>
Falsy: Do not handle the dicimal
// 123456 -> '123,456'
console.log(thousandify(123456))
// 123456.1 -> '123,456.1'
console.log(thousandify(123456.1))
// 123456.123 -> '123,456.123'
console.log(thousandify(123456.123))
Number: The count of decimal
// 123456 -> '123,456.00'
console.log(thousandify(123456, { decimalDigits: 2 }))
// 123456.1-> '123,456.10'
console.log(thousandify(123456.1, { decimalDigits: 2 }))
// 123,456.123 -> '123,456.12'
console.log(thousandify(123456.123, { decimalDigits: 2 }))
// 123,456.123 -> '123,456'
console.log(thousandify(123456.123, { decimalDigits: 0 }))
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
FAQs
Currency thousand format
The npm package thousandify receives a total of 910 weekly downloads. As such, thousandify popularity was classified as not popular.
We found that thousandify 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.