Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

frequency-distribution

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frequency-distribution

Given an array of numbers and range to split, returns frequency of numbers in that range

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

frequency-distribution

Given an array of numbers and range to split, returns frequency of numbers in that range

Install

$ npm install frequency-distribution --save

Usage

import frequencyDistribution from 'frequency-distribution';

frequencyDistribution([1,1, 2, 3,3, 5,5,5,5]) // => { '1': 2, '2': 1, '3': 2, '5': 4 }
frequencyDistribution([1,1, 2, 3,3, 5,5,5,5], 2) // => { '1,2': 3, '3,4': 2, '5,6': 4 }

API

array

Type: Array<Number>
required

rangeLength

Type: number
Default: 1

Length of array Items to split and group. For [1,1,2,2,3,4,5] length 2 becomes [1,1,2,2], [3,4], [5]

License

MIT © Amit Solanki

Keywords

FAQs

Package last updated on 11 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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