open-index/open-npm huggingface dataset:
npm package: @packtrack/discovery
Description: Finds the running packtrack director in a network.
Latest version: 0.0.1

# Discovery
Finds the running packtrack director in a network.

Usage
```
const discovery = new Discovery('device-1234');
const hostname = await discovery.find();
```

Uses UDP ports `142` and `143`.

## Output
By default, all events log to console.
`find` will only resolve if a director was found, and will retry endlessly if not.

The following events are raised while connecting
```
onRequestSent
onRequestSendFail (error)
onRequestDiscovery
onResponse (remote)
onInvalidInvitation
onInvalidInvitationRoute (route)
onInvalidInvitationVersion (version)
```
npm package: @packtrack/protocol
Description: This protocol is used to exchange events and data between members in a packtrack network. UTF-8 is used for encoding and decoding of text.
Latest version: 1.8.1

# PT - Packtrack Protocol
This protocol is used to exchange events and data between members in a packtrack network.
UTF-8 is used for encoding and decoding of text.

Standardized messages are defined in source/messages

Example message:
```
PT control/throttle/display
speed: 0.52
reversed
stopped

Hello, World!
```

## Message Structure
Each message must start with a `PT `.

A route follows, consisting of lowercase latin letters, `-` and numbers conisting of multiple, `/`-separated segments.
There is no leading or trailing `/`.
For future extensions, parsers must ignore everything after the route.

None or multiple headers follow, which may or may not have a value.
A unique header name may contain lowercase latin letters, `-` and numbers.
The name is terminated by `: `, after which an arbritary text value may follow.
The value may contain a `:`, the only illegal character is a `\n`.
If no `:` is found, the value of the header is boolean `true`, indicating a flag.
A header must end with a new line.
Space may be limited on embedded devices, where a cap on header count may be set no smaller than 32.

Setting `null` as a header value will omit it.
This will only work if the header is optional, unexpected nulls might raise an error on the receiving side.

A body may be provided, which starts after the first `\n\n` found in the message.
The body can contain text or binary data.