A minimal Redis-backed library to track online user activity with minute-level granularity. Version 0.0.1, no recent releases. Provides simple add, last, and clear methods. Lightweight and straightforward, but lacks maintenance. Differentiator: minimal API for activity tracking using Redis sets, with no additional features like TTL.
npm install onlineNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up Redis client, creates online tracker, adds a user, retrieves active users, and clears data.
Consider using alternatives like 'connect-redis' or 'redis-activity'. For tracking user online status, build a custom solution with Redis sets and TTL.
Assign the result to a different variable name, e.g., const track = require('online')(db);Ensure Redis client is connected before using the module. Use event listeners on the client to handle errors.
If finer granularity is needed, consider using Redis sorted sets with timestamps or a more modern library.
const online = require('online'); const track = online(redisClient);const redis = require('redis'); const db = redis.createClient();Use the 'redis' package (v2.x) as expected. For ioredis, wrap or use a different library.