2.0.2 • Published 4 years ago

stats-counter v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

stats-counter

Express middleware for counting visits on websites

Usage

app.use(
  statsCounter(
    {
      visitTime: 10,
      apiPath: '/stats',
      savePath: 'statsSave',
      saveInterval: 60
    }
  )
);

Options

visitTime - required - Visit expiration after last request

apiPath - optional - Path for getting stats

savePath - optional - File for saving stats, stats won't be saved if no path provided

saveInterval - optional (defaults to 60) - Interval in seconds

API

HTTP request to apiPath returns stats in following format:

{
  total: {
    total: <total visit count>
    unique: <unique visit count>
  },
  thisMinute: {...},
  thisHour: {...},
  today: {...},
  thisMonth: {...},
  thisYear: {...}
}
2.0.2

4 years ago

2.0.1

4 years ago

1.1.3

4 years ago

2.0.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago