countcharsocurrences
v1.1.2
Published
Count how many times each character appears on string
Downloads
6
Readme
countCharsOcurrences
:pencil: Count how many times each character appears on string. It's a simple package, but if you need to count how many times each character occurs in a big text you can use.
Can be used with CommonJS, AMD or vannila JS in browser.
Example
// not case sensitive example
countCharsOcurrences('ABcC'); // {"A":1,"B":1,"C":2}
// case sensitive example, converts all to upper case
countCharsOcurrences('ABcC', true); //{"A":1,"B":1,"c":1,"C":1}
License
Realease under MIT License
Contributors
Thanks Gabriel Reitz Giannattasio for the simple version