# user-metrics

> general propouse user metrics api

Latest version **1.0.1** (published 2018-11-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install user-metrics
pnpm add user-metrics
yarn add user-metrics
bun add user-metrics
```

## 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.1 |
| Published | 2018-11-05 |
| First published | 2018-11-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Luiz Neto |
| Maintainers | ex4tasmente |
| Keywords | metrics, user |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2018-11-05
- 1.0.0 — 2018-11-05

## README

# User Metrics 

User metrics é uma api de propósito geral para armazenamento de métricas de aplicações web 
# How to Use
 - Add usermetrics in HTML
 ```<script src="../userMetrics.js"></script>```


 - Instantiate userMetrics sending urlServer database api
     ```html
    <script>
    var metrics = new UserMetrics(<urlServer>);
    </script> 
    ```
  - Start the Metrics sending the actual page name and the user Object
       ```html
    <script>
    ...
    metrics.startMetrics("Home",{username:"user",
                                email :"email@mail.com",
                                id:1});
    </script> 
    ```
- Stop the metrics sending de meta data to be stored
    ```html
    <script>
    ...
    metrics.stopMetrics({metaData1 : 1, 
                        metaData2 : "Some String", 
                        metaData3 : false});
    </script>
    ```
- Sending metrics to server api database
  ```html
    <script>
    ...
    metrics.postMetrics().then(
            function(rep){
                console.log(rep)
            },function(err){
                console.log(err)
            });
    </script>
    ```

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