Lightweight TypeScript math utility functions
npm install @alessiofrittoli/math-utils[![NPM Latest Version][version-badge]][npm-url] [![Coverage Status][coverage-badge]][coverage-url] [![Socket Status][socket-badge]][socket-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
[version-badge]: https://img.shields.io/npm/v/%40alessiofrittoli%2Fmath-utils
[npm-url]: https://npmjs.org/package/%40alessiofrittoli%2Fmath-utils
[coverage-badge]: https://coveralls.io/repos/github/alessiofrittoli/math-utils/badge.svg
[coverage-url]: https://coveralls.io/github/alessiofrittoli/math-utils
[socket-badge]: https://socket.dev/api/badge/npm/package/@alessiofrittoli/math-utils
[socket-url]: https://socket.dev/npm/package/@alessiofrittoli/math-utils/overview
[downloads-badge]: https://img.shields.io/npm/dm/%40alessiofrittoli%2Fmath-utils.svg
[deps-badge]: https://img.shields.io/librariesio/release/npm/%40alessiofrittoli%2Fmath-utils
[deps-url]: https://libraries.io/npm/%40alessiofrittoli%2Fmath-utils
[sponsor-badge]: https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2
[sponsor-url]: https://github.com/sponsors/alessiofrittoli
This lightweight TypeScript utility library comes with common and utility math functions.
Everything is exported from the root of this library but specific paths can be used too (especially when dynamically importing functions and tree shaking has no effect).
- Getting started
- What's inside
- Conversion functions
- Formatting functions
- Helpers functions
- Interpolation functions
- Easing functions
- Random number functions
- Types
- Development
- Install depenendencies
- Build the source code
- ESLint
- Jest
- Contributing
- Security
- Credits
---
Run the following command to start using math-utils in your projects:
``bash`
npm i @alessiofrittoli/math-utils
or using pnpm
`bash`
pnpm i @alessiofrittoli/math-utils
---
#### Install depenendencies
`bash`
npm install
or using pnpm
`bash`
pnpm i
#### Build the source code
Run the following command to test and build code for distribution.
`bash`
pnpm build
#### ESLint
warnings / errors check.
`bash`
pnpm lint
#### Jest
Run all the defined test suites by running the following:
`bashRun tests and watch file changes.
pnpm test:watch
package.json file scripts for more info.Run tests with coverage.
An HTTP server is then started to serve coverage files from
./coverage folder.â ď¸ You may see a blank page the first time you run this command. Simply refresh the browser to see the updates.
`bash
test:coverage:serve
`---
$3
Contributions are truly welcome!
Please refer to the Contributing Doc for more information on how to start contributing to this project.
Help keep this project up to date with [GitHub Sponsor][sponsor-url].
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
---
$3
If you believe you have found a security vulnerability, we encourage you to _responsibly disclose this and NOT open a public issue_. We will investigate all legitimate reports. Email
security@alessiofrittoli.it` to disclose any security vulnerabilities.
|