New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

map-number

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-number - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

10

CHANGELOG.md

@@ -0,1 +1,11 @@

# 1.0.8
* improved documentation
* added package keywords
* added jsDelivr badge
# 1.0.7
* dependencies updated
# 1.0.6

@@ -2,0 +12,0 @@

6

package.json
{
"name": "map-number",
"version": "1.0.7",
"version": "1.0.8",
"description": "processing/p5.js map like function, including floating point numbers support",

@@ -19,3 +19,5 @@ "main": "dist/map.cjs.js",

"round",
"limit"
"limit",
"number",
"numbers"
],

@@ -22,0 +24,0 @@ "scripts": {

# 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) [![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) [![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) [![](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) [![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)

@@ -9,6 +9,4 @@ [processing](https://processing.org/reference/map_.html)/[p5.js](http://p5js.org/reference/#/p5/map) map like function, including floating point numbers support

## Usage
## Install
#### Node.js
```bash

@@ -18,8 +16,5 @@ npm install map-number

```javascript
const { map } = require("map-number");
const y = map(Math.sin(angle), -1, 1, 100, 0);
```
## CDN
#### Browser
#### jsDelivr

@@ -30,13 +25,34 @@ ```html

*[more options on jsDelivr website](https://www.jsdelivr.com/package/npm/map-number)*
#### unpkg
```html
<script src="https://unpkg.com/map-number/dist/map.umd.js"></script>
```
## Usage
### Node.js
```javascript
const mapNum = require("map-number");
const y = mapNum.map(Math.sin(angle), -1, 1, 100, 0);
```
### Browser
*after the* `script` *tag has been added,* `mapNum` *will be available globally.*
```javascript
const y = mapNum.map(Math.sin(angle), -1, 1, 100, 0);
```
## API
#### map
### map
*maps a number in a range to a different range, returning a floting point number, including number outside the given output range.*
*maps a number in a range to a different range, returning a floting point number, it may include number outside the given output range.*
> *all other map function variants depend on this one.*
> *this is the core function and all other map function variants depend on this it.*

@@ -49,5 +65,5 @@ ###### syntax

#### floor
### floor
*maps a number in a range to a different range, returning a number truncated to the inmediate previous integer number, including number outside the given output range.*
*maps a number in a range to a different range, returning a number truncated to the inmediate previous integer number, it may include number outside the given output range.*

@@ -60,5 +76,5 @@ ###### syntax

#### round
### round
*maps a number in a range to a different range, returning a number rounded to the closest integer number, including number outside the given output range.*
*maps a number in a range to a different range, returning a number rounded to the closest integer number, it may include number outside the given output range.*

@@ -71,5 +87,5 @@ ###### syntax

#### limit
### limit
*maps a number in a range to a different range, returning a floting point number, limiting the result to the given output range.*
*maps a number in a range to a different range, returning a floting point number, the result will bounded to the given output range.*

@@ -82,3 +98,3 @@ ###### syntax

#### create
### create

@@ -102,3 +118,3 @@ *creates a single argument function implementing the given [`map`](#map), [`floor`](#floor), [`round`](#round) or [`limit`](#limit) function, useful when you need to map values multiple times within the same range, [see example](#example)*

#### wrap
### wrap

@@ -109,2 +125,2 @@ *an alias for [create](#create) method*

[MIT](LICENSE) :copyright: Manuel Fernández
[MIT](LICENSE) &copy; Manuel Fernández
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc