# viewcount

> view counts statistics with redis

Latest version **1.0.2** (published 2017-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install viewcount
pnpm add viewcount
yarn add viewcount
bun add viewcount
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-11-06 |
| First published | 2017-11-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lovegnep |
| Maintainers | lovegnep |
| Keywords | viewcount, redis, express |

## Links

- npm: https://www.npmjs.com/package/viewcount
- npm.io page: https://npm.io/package/viewcount

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-11-06
- 1.0.1 — 2017-11-05
- 1.0.0 — 2017-11-05

## README

# viewcount
---
This package is used to count the view counts. 

It store the value with the redis, so it doesn't matter restart your webserver.

When a client come to view the website first, this middware will set the cookie, and when it come next time, the middware will find that it has come here before by the cookie.


## 1.install
to use the package, your should do follows:

	npm install viewcount

and you should install the redis and cookie-parser before to use this.

## 2.how to use
you can use it like this:

	var cookieParser = require('cookie-parser');
	var viewcount = require('viewcount');
	var app = express();
	app.use(cookieParser());
	app.use('/',viewcount());
	..//some other routes

## 3.get the viewcount
you can get the viewcount like this in your page before render it to client:
	
	<%= viewCount %>

---
_Source: https://npm.io/package/viewcount · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
