Skip to content

Latest commit

Β 

History

History
57 lines (32 loc) Β· 1.06 KB

File metadata and controls

57 lines (32 loc) Β· 1.06 KB

ccount Build Status Coverage Status

Count characters.

Installation

npm:

npm install ccount

Usage

var ccount = require('ccount');

ccount('foo(bar(baz)', '(') // 2
ccount('foo(bar(baz)', ')') // 1

API

ccount(value, character)

Get the total count of character in value.

Parameters
  • value (string) β€” Content, coerced to string.
  • character (string) β€” Single character to look for.
Returns

number β€” Number of times character occurred in value.

License

MIT Β© Titus Wormer