# gt06

> Parses and creates responses for GT06 GPS tracker messages

Latest version **1.0.12** (published 2024-02-21) · ISC license · 0 weekly downloads

## Install

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

## 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.12 |
| Published | 2024-02-21 |
| First published | 2019-06-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 27.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andy Hempel |
| Maintainers | vondraussen |
| Keywords | GPS, Tracker, GT06 |

## Links

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

## Recent versions

- 1.0.12 (latest) — 2024-02-21
- 1.0.10 — 2022-03-22
- 1.0.9 — 2021-12-08
- 1.0.8 — 2021-08-03
- 1.0.7 — 2021-07-30
- 1.0.6 — 2021-07-25
- 1.0.4 — 2020-07-21
- 1.0.3 — 2020-03-28
- 1.0.2 — 2020-03-28
- 1.0.1 — 2019-12-20
- 1.0.0 — 2019-06-22

## README

![Node.js CI](https://github.com/vondraussen/gt06/workflows/Node.js%20CI/badge.svg?branch=master) ![Node.js Package](https://github.com/vondraussen/gt06/workflows/Node.js%20Package/badge.svg)
[![npm audit](https://github.com/vondraussen/gt06/actions/workflows/npm-audit.yml/badge.svg?branch=master)](https://github.com/vondraussen/gt06/actions/workflows/npm-audit.yml)
# GT06 Message Parser
This is a GT06 GPS Tracker message parser implementation. It can be used to implement your own server.
It parses all messages received from the device and creates the response message, if needed.

> Shout out to [Anton Holubenko](https://github.com/AntonHolubenko) because I've copied the initial version from him. [repo/gt06n](https://github.com/AntonHolubenko/gt06n)

## Usage
``` javascript
const Gt06 = require('gt06');
const net = require('net');

var server = net.createServer((client) => {
  var gt06 = new Gt06();
  console.log('client connected');

  client.on('data', (data) => {
    try {
      gt06.parse(data);
    }
    catch (e) {
      console.log('err', e);
      return;
    }

    if (gt06.expectsResponse) {
      client.write(gt06.responseMsg);
    }

    gt06.msgBuffer.forEach(msg => {
      console.log(msg);
    });

    gt06.clearMsgBuffer();
  });
});

server.listen(serverPort, () => {
  console.log('started server on port:', 4711);
});

```

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