{"_id":"@ahmerhh/math-functions","name":"@ahmerhh/math-functions","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.6":{"name":"@ahmerhh/math-functions","version":"1.0.6","description":"Set of simple math utilities.","main":"dist/index.js","scripts":{"test":"tape -r babel-register test/**/*.js | tap-spec","prepublish":"npm run build","build":"babel ./src/index.js --out-file dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/ahmerhh/math-functions.git"},"keywords":["math","functions","utils"],"author":{"name":"ahmerhh","email":"ahmerhabibb@proton.me"},"license":"MIT","bugs":{"url":"https://github.com/ahmerhh/math-functions/issues"},"homepage":"https://github.com/ahmerhh/math-functions#readme","devDependencies":{"babel-cli":"^6.4.0","babel-preset-es2015":"^6.3.13","babel-register":"^6.4.3","is-integer":"^1.0.6","tap-spec":"^4.1.1","tape":"^4.4.0"},"directories":{"test":"test"},"_id":"@ahmerhh/math-functions@1.0.6","gitHead":"f91735076c268e1373383ac23967bb73008d5cb4","_nodeVersion":"18.15.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-jhNcRMIWmpqcmpnZ9PbV17CSlAI8fCDaQdkY8q6zu4N8UsQU9Y3MqDBPe+ED145MxxEz1Ci1qXbXWpJsWfFudw==","shasum":"41bad45fab48de97f0fb709bbe5ff9ab5e634cd3","tarball":"https://registry.npmjs.org/@ahmerhh/math-functions/-/math-functions-1.0.6.tgz","fileCount":6,"unpackedSize":5949,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFgrEJk66xRZx53pG+RD5Xo/klNS5hooUWVDiOlG7APdAiEA4uWpF7p1bW5Uzmbv6Fq+vvHrxVqDuN7CDJPwSdKQXDk="}]},"_npmUser":{"name":"ahmerhh","email":"ahmerhabibb@gmail.com"},"maintainers":[{"name":"ahmerhh","email":"ahmerhabibb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/math-functions_1.0.6_1691925762158_0.0760110575494315"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-13T11:22:42.053Z","1.0.6":"2023-08-13T11:22:42.322Z","modified":"2023-08-13T11:22:42.578Z"},"maintainers":[{"name":"ahmerhh","email":"ahmerhabibb@gmail.com"}],"description":"Set of simple math utilities.","homepage":"https://github.com/ahmerhh/math-functions#readme","keywords":["math","functions","utils"],"repository":{"type":"git","url":"git+https://github.com/ahmerhh/math-functions.git"},"author":{"name":"ahmerhh","email":"ahmerhabibb@proton.me"},"bugs":{"url":"https://github.com/ahmerhh/math-functions/issues"},"license":"MIT","readme":"# Math utils\r\n\r\nSet of simple math utilities.\r\n\r\n## Installation\r\n\r\n```sh\r\n$ npm install --save math-functions\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\n// import a specific function\r\nimport { random } from 'math-functions';\r\n\r\n// or everything at once\r\nimport * as mathUtils from 'math-functions';\r\n\r\nconst value = random(0, 50, true);\r\nconst mapped = mathUtils.map(24, 0, 100, 0, 1);\r\n```\r\n\r\n## API\r\n\r\n#### `val = random(min, max, round)`\r\n\r\n(alias of `getRandomValueInRange`)\r\n\r\nGet a random value in the given [`min`, `max`] range.\r\n`round` is `false` by default.\r\n\r\n#### `val = map(val, inMin, inMax, outMin, outMax)`\r\n\r\n(alias of `mapValueToRange`)\r\n\r\nMap `val` from range [`inMin`, `inMax`] to [`outMin`, `outMax`] range.\r\n\r\n#### `val = isPOT(val)`\r\n\r\n(alias of `isPowerOfTwo`)\r\n\r\nReturns `true` if `val` is a [power of two](https://en.wikipedia.org/wiki/Power_of_two), `false` otherwise.\r\n\r\n## License\r\n\r\nMIT, see [LICENSE.md](https://github.com/ahmerhh/math-functions/blob/master/LICENSE.md) for more details.\r\n","readmeFilename":"README.md"}