Clamp a number
MIT License
npm install math-clamp
import mathClamp from 'math-clamp'; mathClamp(1, {min: 2, max: 4}); //=> 2 mathClamp(1, {min: 2}); //=> 2 mathClamp(5, {max: 4}); //=> 4
Get the average of numbers
The Sindre Sorhus CLI
ES2015 Math.log2() ponyfill
Sum numbers
Normalize the newline characters in a string to `\n`
Delay execution for a given amount of seconds
TAP formatter for ESLint
Round a number to a specific number of decimal places: 1.234 → 1.2
Generate a random integer
Generate random numbers that are consecutively unique
Merge and normalize adjacent or overlapping integer ranges
Generate a random float
Check if something is a float
Get a pretty output of the original, minified, gzipped size of a string or buffer: 130 B → 91 B →...
ES2015 Number.isInteger() ponyfill