npm.io
1.1.2 • Published 10 years ago

countcharsocurrences

Licence
MIT
Version
1.1.2
Deps
0
Vulns
0
Weekly
0

countCharsOcurrences

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

Keywords