@compactjs/remap
v1.0.1
Published
Map a value from one range to another
Downloads
11
Readme
Table of Contents
Install
NPM:
npm install @compactjs/remap
CDN:
<script src="https://unpkg.com/@compactjs/remap/dist/index.umd.js"></script>
Usage
/**
* Maps a value from one range to another
*/
function remap(
value: number,
min: number,
max: number,
targetMin: number,
targetMax: number
): number;
As module:
import { remap } from '@compactjs/remap';
Example:
remap(0.5, 0, 1, 180, 360); // => 270
Run tests
npm run test
Contact
👤 Timo Bechtel
- Website: https://timobechtel.com
- Twitter: @TimoBechtel
- GitHub: @TimoBechtel
🤝 Contributing
Contributions, issues and feature requests are welcome!
- Check issues
- Fork the Project
- Create your Feature Branch (
git checkout -b feat/AmazingFeature
) - Test your changes
npm run test
- Commit your Changes (
git commit -m 'feat: add amazingFeature'
) - Push to the Branch (
git push origin feat/AmazingFeature
) - Open a Pull Request
Commit messages
This project uses semantic-release for automated release versions. So commits in this project follow the Conventional Commits guidelines. I recommend using commitizen for automated commit messages.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Distributed under the MIT License.
This README was generated with ❤️ by readme-md-generator