fre

freq

Tally word frequency from a string or an array of strings.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

2

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

freq Build Status: Master

Tally word frequency from a string or an array of strings.

NPM

Install

npm install freq --save

Use

var freq = require('freq');

freq('My, my, my music hits me so hard Makes me say Oh my Lord');
//  [ 
//      { word: 'my', count: 4 },
//      { word: 'me', count: 2 },
//      { word: 'music', count: 1 },
//      { word: 'hits', count: 1 },
//      { word: 'so', count: 1 },
//      { word: 'hard', count: 1 },
//      { word: 'makes', count: 1 },
//      { word: 'say', count: 1 },
//      { word: 'oh', count: 1 },
//      { word: 'lord', count: 1 } 
//  ]

Freq tries to remove any non-letter character from your string, normalizes them to lowercase, then counts them.

Freq can also take an array of strings (it's original purpose) and will tally across all given strings.


freq(['Kris Kross will make you', 'Jump', 'Jump']);
//  [
//      { word: 'jump', count: 2 },
//      { word: 'kris', count: 1 },
//      { word: 'kross', count: 1 },
//      { word: 'will', count: 1 },
//      { word: 'make', count: 1 },
//      { word: 'you', count: 1 }
//  ]

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial