https://github.com/lnardon/mapalizer
An npm module to map and normalize a value in a given range
https://github.com/lnardon/mapalizer
coordinates module normalizer npm-package react typescript
Last synced: about 1 year ago
JSON representation
An npm module to map and normalize a value in a given range
- Host: GitHub
- URL: https://github.com/lnardon/mapalizer
- Owner: lnardon
- Created: 2020-12-22T08:13:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-24T04:47:44.000Z (about 5 years ago)
- Last Synced: 2025-01-10T17:49:50.053Z (about 1 year ago)
- Topics: coordinates, module, normalizer, npm-package, react, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/mapalizer
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mapalizer
An npm module to map and normalize a value in a given range
[](https://www.npmjs.com/package/mapalizer) [](https://standardjs.com)
## Installation
```bash
npm install mapalizer
```
## Usage
Provide the 5 required arguments in the function call and the normalized value will be returned
```tsx
import useMapalizer from "mapalizer";
const result = useMapalizer(value: number,initalBaseVal: number,finalBaseVal: number,initalTargetVal: number, finalTargetVal: number);
```
## Example
```jsx
import useMapalizer from "mapalizer";
const result = useMapalizer(10, 1, 100, 20, 30);
```