countcharsocurrences

Count how many times each character appears on string

Usage no npm install needed!

<script type="module">
  import countcharsocurrences from 'https://cdn.skypack.dev/countcharsocurrences';
</script>

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