# tbav3

> Node.js wrapper for the blue alliance v3 api.

Latest version **1.1.2** (published 2018-03-23) · Unlicense license · 0 weekly downloads

## Install

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

## 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.1.2 |
| Published | 2018-03-23 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shaun Keys |
| Maintainers | sploders101 |
| Keywords | thebluealliance, bluealliance, frc, events-api |

## Links

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

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2018-03-23
- 1.1.1 — 2018-03-23
- 1.1.0 — 2018-03-22
- 1.0.1 — 2018-02-21
- 1.0.0 — 2018-02-20

## README

# tbav3
Node.js wrapper for The Blue Alliance api.

---
## Another one?!
This API was inspired by [frc7308's bluealliance bindings](https://github.com/nitroxplunge/bluealliance/blob/master/src/bluealliance.js), and uses many of their concepts and naming conventions, but as I looked through their code, I decided that I needed a rewrite based more on node.js, using built-in libraries (namely https rather than 3rd-party XMLHttpRequest), removing class-like function calls (ex:)
```javascript
var team;
tba.getTeam(4418).then((team) => {
	tba.getEventsForTeam(team).then((events) => {
		doSomething(events);
	});
});
```
(translates to java as:)
```java
new EventsForTeam(new Team(4418));
```
which makes it much simpler for someone with background in java to pick it up. You should definitely check theirs out though, if you are more java-minded and want things to work like your robot code with less of a learning curve. This api attempts to rewrite the one from frc7308 to conform to Node.js coding practices.

## Documentation
### Declaration
```javascript
var tba = new (require("tbav3"))("api_key");
//or
var BlueAlliance = require("tbav3");
var tba = new BlueAlliance("api_key");
```
### Methods (Better descriptions coming soon)
```javascript
tba.callTBA(request).then((data) => {
	doStuff(data);
});
```

```javascript
tba.getTeam(teamNumber).then((team) => {
	doStuff(team);
});
```

```javascript
tba.getTeamAtEvent(teamNumber,eventCode,/*optional*/ year).then((rankings) => {
	doStuff(rankings);
});
```

```javascript
tba.getMatchesForTeam(teamNumber,eventCode,/*optional*/ year).then((matches) => {
	doStuff(matches); //Pre-sorted in chronological order
});
```

```javascript
tba.getNextMatch(teamNumber,eventCode).then((match) => {
	doStuff(match);
});
```

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