# lewibs-keylogger

> a package used to log the keys that the user is currently holding and the history of what they have pressed

Latest version **1.0.6** (published 2022-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install lewibs-keylogger
pnpm add lewibs-keylogger
yarn add lewibs-keylogger
bun add lewibs-keylogger
```

## 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.6 |
| Published | 2022-08-11 |
| First published | 2022-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | lewibs |
| Maintainers | lewibs |
| Keywords | key, logger, event, listener, addEventListener, target, javascript, js, keylogger |

## Links

- npm: https://www.npmjs.com/package/lewibs-keylogger
- Repository: https://github.com/lewibs/keylogger
- Homepage: https://github.com/lewibs/keylogger#readme
- Issues: https://github.com/lewibs/keylogger/issues
- npm.io page: https://npm.io/package/lewibs-keylogger

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.6 (latest) — 2022-08-11
- 1.0.5 — 2022-07-09
- 1.0.4 — 2022-07-09
- 1.0.3 — 2022-07-09
- 1.0.2 — 2022-07-09
- 1.0.1 — 2022-07-09
- 1.0.0 — 2022-07-09

## README

# lewibs-keylogger
This is used to log the keys that the user presses in browser

# usage

To use lewibs-keylogger in a project:
```js
  npm install lewibs-keylogger
```

```js
  import Keylogger from 'lewibs-keylogger';
  
  //activate global
  Keylogger.instance.start();
  
  //or

  //new keylogger instannce
  let logger = new Keylogger();
```

There are 3 important fields to note:

Keylogger.prototype.pressed which is:
```js
  {
    keynames:bool
  }
```
  
Keylogger.prototype.history which is:
```js
  [{
    pressed:{keynames:bool},
    time: unixTimeInt,
    event: Event,
  }]
```

Keylogger.instance
```js
  Keylogger.instance : new Keylogger();
```
  
Additionally there are three prototypes attached:
```js
  start() : which starts logging
  stop(): which pauses the logging
  kill(): which pauses the logging and also removes the history
```

Overall you get an object which looks like this:
```js
  {
    //privates
    _events: [],
    _running: true,
    
    //public fields
    isKeylogger: true,
    global: Keylogger,
    pressed: {},
    history[],
    
    //public methods
    start: start(),
    stop: stop(),
    kill: kill(),
  }
```

finally there are four unique keys:
```js
  const WHEEL = "wheel";
  const LEFTMOUSE = "leftmouse";
  const MIDDLEMOUSE = "middlemouse";
  const RIGHTMOUSE = "rightmouse";
```

# test
to test the keylogger run the test dir as a standard react program

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