ccount
Count characters
Last updated 6 years ago by wooorm .
MIT · Repository · Bugs · Original npm
$ cnpm install ccount 
SYNC missed versions from official npm registry.

ccount

Build Coverage Downloads Size

Count characters.

Install

npm:

npm install ccount

Use

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

Current Tags

  • 2.0.1                                ...           latest (4 years ago)

4 Versions

  • 1.1.0                                ...           5 years ago
  • 2.0.1                                ...           4 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.5                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (8)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org