counts

Count sets of stuff! This is useful for reference counting sets of things for which you have an identifier.

Usage no npm install needed!

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

README

counts

Count sets of stuff! This is useful for reference counting sets of things for which you have an identifier.

Install

npm install counts

Usage

var counts = new Counts()
counts.inc('foo')
counts.inc('foo', 2)
counts.get('foo') // returns 3
counts.dec('foo')
counts.dec('foo', 2)
counts.has('foo') // return false