# antelopejs

> ![Jackalope](https://banner2.cleanpng.com/20180418/uve/kisspng-a-pronghorn-antelope-a-pronghorn-antelope-drawing-elk-vector-5ad7b2864d63e4.504981951524085382317.jpg)

Latest version **1.0.24** (published 2020-08-03) · (MIT OR Apache-2.0) license · 0 weekly downloads

## Install

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

## 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.24 |
| Published | 2020-08-03 |
| First published | 2020-07-30 |
| Weekly downloads | 0 |
| License | (MIT OR Apache-2.0) |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Morgan Brown |
| Maintainers | morganb816 |

## Links

- npm: https://www.npmjs.com/package/antelopejs
- Repository: https://github.com/Morganb816/Antelope
- Issues: https://github.com/Morganb816/Antelope/issues
- npm.io page: https://npm.io/package/antelopejs

## Recent versions

- 1.0.24 (latest) — 2020-08-03
- 1.0.23 — 2020-08-03
- 1.0.22 — 2020-07-31
- 1.0.21 — 2020-07-31
- 1.0.20 — 2020-07-31
- 1.0.19 — 2020-07-31
- 1.0.18 — 2020-07-31
- 1.0.16 — 2020-07-31
- 1.0.15 — 2020-07-31
- 1.0.14 — 2020-07-30
- 1.0.13 — 2020-07-30
- 1.0.12 — 2020-07-30
- 1.0.11 — 2020-07-30
- 1.0.10 — 2020-07-30
- 1.0.9 — 2020-07-30
- … 9 more at https://npm.io/package/antelopejs/versions

## README

# Antelope Networking

![Jackalope](https://banner2.cleanpng.com/20180418/uve/kisspng-a-pronghorn-antelope-a-pronghorn-antelope-drawing-elk-vector-5ad7b2864d63e4.504981951524085382317.jpg)

---

## [Example](https://antelope-networking-example.herokuapp.com/)

## [Documentation](https://morganb816.github.io/Antelope/)

## About
### What it is:
Antelope Networking is a library used to help develop JavaScript multiplayer games with a determanistic client server architecture.
Antelope should be considered the layer in between, just barely reaching into both your client and your server.

### What it isn't:
Antelope will not help with things like user input or server architecture.

### What it Might Be:
In the future I plan on extracting Socket.IO in favor of writing our own WebSocket solution. Socket.IO is heavy and unnecesary for a solution like this, but to get MVP working the decision has been made to just endure. In the future, writing a Unity Client port would be a great opportunity. As of now I think keeping it JS on the client side is a win because of the ability to share code between the server and client in terms of movement methods etc.

---
## Motivation
Antelope Networking is mostly a pet project for me to learn more about networking architecture. At the moment I believe that there is a considerable lack of networking implementations that are easy to use and follow client/server architecture.

---
## Features
* Client Side Reconciliation
* Server Side Value Validation
* Flexable: Antelope just track values. what you do with them is up to you.

---
## Examples
#### Client
```js
const xPosition = new ClientNetowrkValue(10, 'x-posiiton', socket);

xPosition.set(5);

xPosition.get();
```

#### Server
```js

function validate(newPos, input) {
    if (movementIsPossible(oldPos, newPos, input)) {
        return newPos;
    } else {
        getNewPosition(oldPos, input);
    }
}

const xPosition = new ServerNetworkValue('x-position', validate, socket);
```
---
## Tests
Antelope utilizes Mocha and Chai for testing. To run the tests you can `npm run test`.

---
## License
MIT License

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