
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.
bignumber-to-string
Advanced tools
A tiny module to convert BigNumbers to strings that are nested within objects or arrays
A tiny module to convert BigNumbers to strings that are nested within objects or arrays
npm install bignumber-to-string
BigNumbers are used in various applications, however, most do not want to store the complex BigNumber object itself in their state or DB. Converting the BigNumber to a string keeps data precision while being easier to store.
const bigNumberToString = require('bignumber-to-string')
const obj = {
data: 100,
somedata: 'sdfsdfsd',
bn: new BigNumber(1000),
something: {
bn: new BigNumber(10000)
}
}
console.log(bigNumberToString(obj))
/*
returns:
{
data: 100,
somedata: 'sdfsdfsd',
bn: '1000',
something: {
bn: '10000'
}
}
*/
Converts any BigNumber objects to a string while bypassing everything else
Parameters
obj
Object|Array|String|Boolean|Function input database
Number base integer for string conversionReturns Variable if BigNumber, returns string, else returns what ever input type with BigNumbers converted to strings
npm test
The MIT License (MIT)
Copyright (c) 2016 Nick Dodson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FAQs
A tiny module to convert BigNumbers to strings that are nested within objects or arrays
The npm package bignumber-to-string receives a total of 2 weekly downloads. As such, bignumber-to-string popularity was classified as not popular.
We found that bignumber-to-string 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.