1.3.1 • Published 4 years ago

@remusao/counter v1.3.1

Weekly downloads
48
License
MPL-2.0
Repository
github
Last release
4 years ago

@remusao/counter

A simpler counter implementation inspired by Python's Counter

Usage

const { Counter } = require('@remusao/counter');
const counter = new Counter([
  ['foo', 2],
  ['bar', 1],
]); // optional init

counter.has('foo'); // true
counter.get('foo'); // 2

counter.has('baz'); // false
counter.get('baz'); // 0
counter.incr('baz');
counter.has('baz'); // true
counter.get('baz'); // 1
counter.decr('baz');
counter.has('baz'); // false
counter.get('baz'); // 0
1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago