@compactjs/remap
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@compactjs/remap

Map a value from one range to another

Version License: MIT

· Homepage · Report Bug / Request Feature ·

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

🤝 Contributing

Contributions, issues and feature requests are welcome!

  1. Check issues
  2. Fork the Project
  3. Create your Feature Branch (git checkout -b feat/AmazingFeature)
  4. Test your changes npm run test
  5. Commit your Changes (git commit -m 'feat: add amazingFeature')
  6. Push to the Branch (git push origin feat/AmazingFeature)
  7. 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

Readme

Keywords

Package Sidebar

Install

npm i @compactjs/remap

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

7.67 kB

Total Files

14

Last publish

Collaborators

  • timobechtel