GeisonJr / json-transfer-protocol

JTP (JSON Transfer Protocol)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

JTP (JSON Transfer Protocol) Library

Easy to use, fast and lightweight library for Node.js.

CI CD LICENSE NPM version NPM downloads

🚧 This project is under development and is not yet ready for use.

🌱 Overview

JTP is a protocol for transferring data between systems. It facilitates communication between systems using JSON (JavaScript Object Notation) as the data format and relies on the TCP/IP protocol for data transfer.

HTTP Example

Data as string

POST /api/test HTTP/1.1
Host: localhost:3000
Content-Type: text/plain

Hello World!!

Data as object

POST /api/test HTTP/1.1
Host: localhost:3000
Content-Type: application/json

{
  "name": "Geison",
  "age": 23
}

JTP Example

Data as string

{
  "head": {
    "host": "localhost:3000" // The domain name or IP address of the target server.
    "method": "CREATE" // Follow the CRUD operations
    "path": "/api/test" // The path of the endpoint
  }
  "body": {
    "type": "string" // The type of the body
    "data": "Hello World!!" // The data of the body
  }
}

Data as object

{
  "head": {
    "host": "localhost:3000",
    "method": "CREATE",
    "path": "/api/test"
  }
  "body": {
    "type": "object",
    "data": {
      "name": "Geison",
      "age": 23
    }
  }
}

About

JTP (JSON Transfer Protocol)

License:MIT License


Languages

Language:TypeScript 81.4%Language:JavaScript 18.6%