https://github.com/supercharge/numbers
Number utilities for Node.js and JavaScript
https://github.com/supercharge/numbers
hacktoberfest nodejs numbers supercharge
Last synced: 6 months ago
JSON representation
Number utilities for Node.js and JavaScript
- Host: GitHub
- URL: https://github.com/supercharge/numbers
- Owner: supercharge
- License: mit
- Created: 2020-02-06T15:05:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-15T07:38:59.000Z (about 4 years ago)
- Last Synced: 2025-04-20T23:33:08.597Z (6 months ago)
- Topics: hacktoberfest, nodejs, numbers, supercharge
- Language: TypeScript
- Homepage:
- Size: 56.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Numbers
Number utilities for Node.js and JavaScript
Installation ·
Docs ·
Usage
Follow @marcuspoehls and @superchargejs for updates!
---
## Introduction
The `@supercharge/numbers` package extends JavaScripthttps://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Numbers [`Number`](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Number) class to provide additional helper methods when working with numbers, like generating a random number in a given range.## Installation
```
npm i @supercharge/numbers
```## Docs
Find all the [details for `@supercharge/numbers` in the extensive Supercharge docs](https://superchargejs.com/docs/numbers).## Usage
Using `@supercharge/numbers` is pretty straightforward. Use the exposed static methods directly from the imported package:```js
const Num = require('@supercharge/numbers')Num.randomIntWithin(0, 10)
// 10
// returns a number from 0 to 10 (inclusive start and end)Num.randomIntBetween(0, 10)
// 4
// returns a number from 1 to 9 (exclusive start and end)Num(10).isInRange(0, 10)
// true (min and max are inclusive)
```## Contributing
Do you miss a string function? We very much appreciate your contribution! Please send in a pull request 😊1. Create a fork
2. Create your feature branch: `git checkout -b my-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request 🚀## License
MIT © [Supercharge](https://superchargejs.com)---
> [superchargejs.com](https://superchargejs.com) ·
> GitHub [@supercharge](https://github.com/supercharge) ·
> Twitter [@superchargejs](https://twitter.com/superchargejs)