Gathering detailed insights and metrics for @ethjs-staging/number-to-bn
Gathering detailed insights and metrics for @ethjs-staging/number-to-bn
Gathering detailed insights and metrics for @ethjs-staging/number-to-bn
Gathering detailed insights and metrics for @ethjs-staging/number-to-bn
Converts a number to a BN.js object, throw if invalid number.
npm install @ethjs-staging/number-to-bn
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
9 Commits
13 Forks
2 Watchers
2 Branches
1 Contributors
Updated on May 26, 2023
Latest Version
1.7.1-rc0
Package Id
@ethjs-staging/number-to-bn@1.7.1-rc0
Unpacked Size
286.14 kB
Size
58.41 kB
File Count
14
NPM Version
6.14.17
Node Version
14.21.1
Published on
Jan 10, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
A simple method to convert integer or hex integer numbers to BN.js object instances. Does not supprot decimal numbers.
npm install --save number-to-bn
1const numberToBN = require('number-to-bn'); 2 3console.log(numberToBN('-1')); 4 5// result <BN ...> -1 6 7console.log(numberToBN(1)); 8 9// result <BN ...> 1 10 11console.log(numberToBN(new BN(100))); 12 13// result <BN ...> 100 14 15console.log(numberToBN(new BigNumber(10000))); 16 17// result <BN ...> 10000 18 19console.log(numberToBN('0x0a')); 20 21// result <BN ...> 10 22 23console.log(numberToBN('-0x0a')); 24 25// result <BN ...> -10 26 27console.log(numberToBN('0.9')); // or {}, [], undefined, 9.9 28 29// throws new Error(...) 30 31console.log(numberToBN(null)); // or {}, [], undefined, 9.9 32 33// throws new Error(...)
This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md.
The MIT License
Copyright (c) 2016 Nick Dodson. nickdodson.com
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.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More