1.2.5 • Published 10 months ago

@microlink/ua v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Last version Coverage Status NPM Status

A simple redis primitives to incr() and top() user agents.

Install

npm install @microlink/ua

Usage

First, initialize the library passing a Redis instance:

const Redis = require('ioredis')
const redis = new Redis()
const ua = require('@microlink/ua')(redis)

After that, the library offers the following methods:

  • incr(userAgent) — e.g. ua.incr(req.headers['user-agent']) Increment the counter associated with an user agent.

  • top(n, { withScore }) — e.g. ua.top(100) Returns an array of the N ranked from from top.

  • flush — e.g. ua.delete() Delete elements.

License

microlink/ua © microlink.io, released under the MIT License. Authored and maintained by Kiko Beats with help from contributors.

microlink.io · GitHub microlink.io · X @microlinkhq

1.2.5

10 months ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago