1.4.0 • Published 1 year ago

@remusao/counter v1.4.0

Weekly downloads
48
License
MPL-2.0
Repository
github
Last release
1 year 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.4.0

1 year ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago