{"id":15111326,"url":"https://github.com/geisonjr/json-transfer-protocol","last_synced_at":"2026-01-05T23:03:36.992Z","repository":{"id":256672389,"uuid":"856065074","full_name":"GeisonJr/json-transfer-protocol","owner":"GeisonJr","description":"A simple transfer protocol proposal using JSON","archived":false,"fork":false,"pushed_at":"2024-09-15T14:55:21.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T22:21:43.158Z","etag":null,"topics":["ip","json","jtp","nodejs","protocol","tcp","transfer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeisonJr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-11T23:39:48.000Z","updated_at":"2024-12-20T01:33:36.000Z","dependencies_parsed_at":"2024-09-12T11:04:27.566Z","dependency_job_id":null,"html_url":"https://github.com/GeisonJr/json-transfer-protocol","commit_stats":null,"previous_names":["geisonjr/json-transfer-protocol"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeisonJr%2Fjson-transfer-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeisonJr%2Fjson-transfer-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeisonJr%2Fjson-transfer-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeisonJr%2Fjson-transfer-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeisonJr","download_url":"https://codeload.github.com/GeisonJr/json-transfer-protocol/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246037823,"owners_count":20713477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ip","json","jtp","nodejs","protocol","tcp","transfer"],"created_at":"2024-09-26T00:03:30.133Z","updated_at":"2026-01-05T23:03:31.941Z","avatar_url":"https://github.com/GeisonJr.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\r\n  JTP (JSON Transfer Protocol) Library\r\n\u003c/h1\u003e\r\n\u003cdiv align=\"center\"\u003e\r\n\r\nEasy to use, fast and lightweight library for Node.js.\r\n\r\n\u003c/div\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n[![LICENSE](https://img.shields.io/github/license/geisonjr/json-transfer-protocol?style=flat)](https://github.com/GeisonJr/json-transfer-protocol/blob/main/LICENSE)\r\n[![NPM version](https://img.shields.io/npm/v/@geisonjr/json-transfer-protocol?style=flat)](https://npmjs.com/package/@geisonjr/json-transfer-protocol)\r\n[![NPM downloads](https://img.shields.io/npm/dt/@geisonjr/json-transfer-protocol?style=flat)](https://npmjs.com/package/@geisonjr/json-transfer-protocol)\r\n\r\n\u003c/div\u003e\r\n\r\n\u003e :construction: This project is under development and is not yet ready for use.\r\n\r\n## :link: Table of Contents\r\n\r\n- :bulb: [About](#bulb-about)\r\n- :rocket: [Tecnologies](#rocket-tecnologies)\r\n- :construction_worker: [How to run](#construction_worker-how-to-run)\r\n- :book: [Documentation](#book-documentation)\r\n- :handshake: [How to Contribute](#handshake-how-to-contribute)\r\n- :memo: [License](#memo-license)\r\n\r\n## :bulb: About\r\n\r\nJTP 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.\r\n\r\n### JTP Request Example\r\n\r\n```jsonc\r\n{\r\n  \"head\": {\r\n    \"host\": \"example.com:6969\",\r\n    \"method\": \"CREATE\",\r\n    \"path\": \"/api/v1\"\r\n  },\r\n  \"body\": {\r\n    \"type\": \"string\",\r\n    \"data\": \"Hello World!!\"\r\n  }\r\n}\r\n```\r\n\r\n## :rocket: Tecnologies\r\n\r\nThe following tools were used in the construction of the project:\r\n\r\n- [Node.js](https://nodejs.org/en/)\r\n- [TypeScript](https://www.typescriptlang.org/)\r\n\r\n## :construction_worker: How to run\r\n\r\n### Installation\r\n\r\n```bash\r\nnpm install @geisonjr/json-transfer-protocol\r\n```\r\n\r\nor using yarn\r\n\r\n```bash\r\nyarn add @geisonjr/json-transfer-protocol\r\n```\r\n\r\n## :book: Documentation\r\n\r\n### Configure the `env` file for the client\r\n\r\n```.env\r\n# Host address of the client\r\nCLIENT_HOST=127.0.0.1\r\n# Port the client will use\r\nCLIENT_PORT=6969\r\n# Indicates if the client uses a secure connection\r\nCLIENT_SECURE=true\r\n```\r\n\r\n### Configure the `env` file for the server\r\n\r\n```.env\r\n# Host address of the server\r\nSERVER_HOST=127.0.0.1\r\n# Port the server will use\r\nSERVER_PORT=6969\r\n# Indicates if the server uses SSL for secure connections\r\nSERVER_SECURE=true\r\n# Path to the server SSL certificate\r\nSERVER_CERT=/certs/cert.pem\r\n# Path to the server SSL key\r\nSERVER_KEY=/certs/key.pem\r\n# Path to the Certificate Authority (CA) certificate\r\nSERVER_CA=/certs/ca.pem\r\n```\r\n\r\n### Configure the `env` file for the logger\r\n\r\n```.env\r\n# Directory where logs will be stored\r\nLOG_DIR=./logs\r\n# Enables or disables logging\r\nLOG=false\r\n# Maximum size of the log file\r\nLOG_MAX=1000000\r\n# Defines if logs will be displayed in the console\r\nLOG_CONSOLE=true\r\n# Defines if logs will be formatted as JSON\r\nLOG_JSON=false\r\n# Defines if logs will be formatted as text\r\nLOG_LOG=false\r\n# Enables or disables DEBUG log level\r\nLOG_DEBUG=true\r\n# Enables or disables INFO log level\r\nLOG_INFO=true\r\n# Enables or disables WARN log level\r\nLOG_WARN=true\r\n# Enables or disables ERROR log level\r\nLOG_ERROR=true\r\n# Enables or disables FATAL log level\r\nLOG_FATAL=true\r\n# Enables or disables TRACE log level\r\nLOG_TRACE=true\r\n```\r\n\r\n### Create a server\r\n\r\n```typescript\r\nimport { Server, Status } from '@geisonjr/json-transfer-protocol';\r\n\r\nconst server = new Server({\r\n  port: 6969\r\n});\r\n\r\nserver.start();\r\n\r\nserver.create('/api/test', (req, res) =\u003e {\r\n\r\n  const name = req.body.data.name;\r\n\r\n  res.status = Status.OK;\r\n  res.body = {\r\n    type: 'string',\r\n    data: `Hello, ${name}`\r\n  };\r\n});\r\n```\r\n\r\n### Create a request\r\n\r\n```typescript\r\nimport { fetcher } from '@geisonjr/json-transfer-protocol';\r\n\r\nconst response = await fetcher({\r\n  head: {\r\n    host: 'example.com',\r\n    method: 'CREATE',\r\n    path: '/api/test'\r\n  },\r\n  body: {\r\n    type: 'object',\r\n    data: {\r\n      name: 'Geison',\r\n      age: 23\r\n    }\r\n  }\r\n});\r\n\r\nif (!response.success) {\r\n  console.error(response.data);\r\n  return;\r\n}\r\n\r\nconsole.log(response.data);\r\n```\r\n\r\n## :handshake: How to Contribute\r\n\r\nPull requests are welcome. For major changes, please open an issue first to\r\ndiscuss what you would like to change.\r\n\r\nPlease make sure to update tests as appropriate.\r\n\r\n## :memo: License\r\n\r\nThis project is under the\r\n[MIT License](https://github.com/GeisonJr/json-transfer-protocol/blob/main/LICENSE).\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeisonjr%2Fjson-transfer-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeisonjr%2Fjson-transfer-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeisonjr%2Fjson-transfer-protocol/lists"}