Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nora-soderlund/jsonmessages
A low effort, no time consuming, communication format for JSON objects for web messages.
https://github.com/nora-soderlund/jsonmessages
Last synced: 21 days ago
JSON representation
A low effort, no time consuming, communication format for JSON objects for web messages.
- Host: GitHub
- URL: https://github.com/nora-soderlund/jsonmessages
- Owner: nora-soderlund
- Created: 2022-11-25T22:32:04.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-29T18:19:48.000Z (almost 2 years ago)
- Last Synced: 2024-05-04T06:41:04.037Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON supported communication format
A low effort, no time consuming, communication format for JSON objects through for example internal APIs, web socket servers, etc.## Manifests
1. At the start of a communication session (after the handshake): a manifest should be estabilished from the server connecting a key to a message header.
- A message’s header can range from 1 to 255^2.
2. The manifest should have a header of 0 if sent through this communication format.
3. Any message sent with a header byte not in the manifest will be ignored.
## Messages
1. The first byte of a message should be a star character (*).
2. The second and third byte should be the high and low bytes of the message header.
2. The fourth to last byte of a message should be the payload.
- The payload should contain the value of each property as defined in the message manifest, in the correct indexed order.
- Each property should not have a type identifier, such as quotations for strings. Each property is read raw.
- Each property should be seperated by a comma/pipe character.
- If a property contains a comma/pipe character, it should be suffixed with a backslash character to escape it.## Example
```
*??Swedish,SV|English,EN|Danish,DK // 34 bytes
```
```js
[{"language":"Swedish","code":"SV"},{"language":"English","code":"EN"},{"language":"Danish","code":"DK"}] // 105 bytes
```
```json
[
{
"language": "Swedish",
"code": "SV"
},
{
"language": "English",
"code": "EN"
},
{
"language": "Danish",
"code": "DK"
}
]
```