map-number
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -0,1 +1,6 @@ | ||
# 1.0.13 | ||
* added install size badge | ||
* improved documentation | ||
# 1.0.12 | ||
@@ -2,0 +7,0 @@ |
{ | ||
"name": "map-number", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "processing/p5.js map like function, including floating point numbers support", | ||
@@ -5,0 +5,0 @@ "main": "dist/map.cjs.js", |
# map-number | ||
[![CircleCI](https://circleci.com/gh/manferlo81/map-number.svg?style=svg)](https://circleci.com/gh/manferlo81/map-number) [![Greenkeeper badge](https://badges.greenkeeper.io/manferlo81/map-number.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/map-number.svg)](https://www.npmjs.com/package/map-number) [![](https://data.jsdelivr.com/v1/package/npm/map-number/badge?style=rounded)](https://www.jsdelivr.com/package/npm/map-number) [![dependencies Status](https://david-dm.org/manferlo81/map-number/status.svg)](https://david-dm.org/manferlo81/map-number) [![devDependencies Status](https://david-dm.org/manferlo81/map-number/dev-status.svg)](https://david-dm.org/manferlo81/map-number?type=dev) [![npm bundle size](https://img.shields.io/bundlephobia/min/map-number.svg)](https://bundlephobia.com/result?p=map-number) [![npm type definitions](https://img.shields.io/npm/types/map-number.svg)](https://github.com/microsoft/typescript) [![codecov](https://codecov.io/gh/manferlo81/map-number/branch/master/graph/badge.svg)](https://codecov.io/gh/manferlo81/map-number) [![Known Vulnerabilities](https://snyk.io/test/github/manferlo81/map-number/badge.svg?targetFile=package.json)](https://snyk.io/test/github/manferlo81/map-number?targetFile=package.json) [![GitHub](https://img.shields.io/github/license/manferlo81/map-number.svg)](LICENSE) | ||
[![CircleCI](https://circleci.com/gh/manferlo81/map-number.svg?style=svg)](https://circleci.com/gh/manferlo81/map-number) [![Greenkeeper badge](https://badges.greenkeeper.io/manferlo81/map-number.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/map-number.svg)](https://www.npmjs.com/package/map-number) [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/map-number/badge?style=rounded)](https://www.jsdelivr.com/package/npm/map-number) [![dependencies Status](https://david-dm.org/manferlo81/map-number/status.svg)](https://david-dm.org/manferlo81/map-number) [![devDependencies Status](https://david-dm.org/manferlo81/map-number/dev-status.svg)](https://david-dm.org/manferlo81/map-number?type=dev) [![install size](https://packagephobia.now.sh/badge?p=map-number)](https://packagephobia.now.sh/result?p=map-number) [![npm bundle size](https://img.shields.io/bundlephobia/min/map-number.svg)](https://bundlephobia.com/result?p=map-number) [![npm type definitions](https://img.shields.io/npm/types/map-number.svg)](https://github.com/microsoft/typescript) [![codecov](https://codecov.io/gh/manferlo81/map-number/branch/master/graph/badge.svg)](https://codecov.io/gh/manferlo81/map-number) [![Known Vulnerabilities](https://snyk.io/test/github/manferlo81/map-number/badge.svg?targetFile=package.json)](https://snyk.io/test/github/manferlo81/map-number?targetFile=package.json) [![GitHub](https://img.shields.io/github/license/manferlo81/map-number.svg)](LICENSE) | ||
@@ -12,3 +12,3 @@ [processing](https://processing.org/reference/map_.html)/[p5.js](http://p5js.org/reference/#/p5/map) map like function, including floating point numbers support | ||
```bash | ||
npm install map-number | ||
npm i map-number | ||
``` | ||
@@ -18,9 +18,17 @@ | ||
#### jsDelivr | ||
### jsDelivr | ||
*[www.jsdelivr.com](https://www.jsdelivr.com)* | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/map-number/dist/map.umd.js"></script> | ||
``` | ||
##### for production | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/map-number/dist/map.umd.min.js"></script> | ||
``` | ||
*[more options on jsDelivr website](https://www.jsdelivr.com/package/npm/map-number)* | ||
*[more options...](https://www.jsdelivr.com/package/npm/map-number)* | ||
@@ -33,2 +41,4 @@ #### unpkg | ||
*[more options...](https://unpkg.com/map-number/)* | ||
## Usage | ||
@@ -108,6 +118,13 @@ | ||
```javascript | ||
import { map, create } from "map-number"; | ||
const myMap = create(map, -1, 1, 100, 0); | ||
myMap(Math.sin(angle)); | ||
myMap(Math.sin(angle1)); | ||
myMap(Math.sin(angle2)); | ||
// ... is equivalent to... | ||
map(Math.sin(angle), -1, 1, 100, 0); | ||
map(Math.sin(angle1), -1, 1, 100, 0); | ||
map(Math.sin(angle2), -1, 1, 100, 0); | ||
``` | ||
@@ -114,0 +131,0 @@ |
22802
135