包详细信息

@microlink/ua

microlinkhq299MIT1.2.5

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

bot, crawlers, googlebot, redis

自述文件

microlink logo microlink logo

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

更新日志

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.2.5 (2024-09-23)

1.2.4 (2024-05-07)

1.2.3 (2024-02-16)

1.2.2 (2024-02-08)

1.2.1 (2024-01-13)

1.2.0 (2024-01-07)

Features

1.1.0 (2024-01-01)

Features

1.0.0 (2023-12-28)