{"id":29643086,"url":"https://github.com/raito-cache-server/raito-client","last_synced_at":"2025-07-21T23:02:41.155Z","repository":{"id":268436567,"uuid":"904348964","full_name":"raito-cache-server/raito-client","owner":"raito-cache-server","description":"WebSocket client to communicate with raito-cache server","archived":false,"fork":false,"pushed_at":"2025-02-02T19:06:37.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T12:05:49.374Z","etag":null,"topics":[],"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/raito-cache-server.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-16T18:03:37.000Z","updated_at":"2025-03-10T12:44:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"886d94c0-c8b7-4ac2-b0e9-3fae763fd6f5","html_url":"https://github.com/raito-cache-server/raito-client","commit_stats":null,"previous_names":["stbestichhh/raito-client"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/raito-cache-server/raito-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raito-cache-server%2Fraito-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raito-cache-server%2Fraito-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raito-cache-server%2Fraito-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raito-cache-server%2Fraito-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raito-cache-server","download_url":"https://codeload.github.com/raito-cache-server/raito-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raito-cache-server%2Fraito-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266398442,"owners_count":23922461,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-07-21T23:02:40.601Z","updated_at":"2025-07-21T23:02:41.145Z","avatar_url":"https://github.com/raito-cache-server.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM Version](https://img.shields.io/npm/v/@raito-cache/client)](https://www.npmjs.com/package/@raito-cache/client)\n[![Node.js CI](https://github.com/stbestichhh/raito-client/actions/workflows/node.js.yml/badge.svg)](https://github.com/stbestichhh/raito-client/actions/workflows/node.js.yml)\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\n# raito-expressjs\n\n## Table of contents\n\n* [Description](#about)\n* [Getting started](#getting-started)\n* [API](#api)\n* [Deployment](#deployment)\n* [Contributing](#contributing)\n* [Changelog](#changelog)\n* [Authors](#authors)\n* [License](#license)\n\n## About\n\n**raito-client** - is an API for communicating with **[Raito](https://github.com/stbestichhh/raito-cache) cache server**.\n\n## Getting started\n\n\u003e [!IMPORTANT]\n\u003e **Node.js 18.x+** version must be installed in your OS.\n\n#### 1. Install server\n  ```shell\n  $ yarn add @raito-cache/client\n  ```\n\n#### 2. Connect to Raito\n```typescript\nimport { Raito } from '@raito-cache/client';\n\nconst raito = new Raito(); // defaul connection is localhost:9180\n```\n\n## API\n\n### Connect to Raito\n```typescript\nnew Raito(); // Connect to localhost:9180\nnew Raito(7180); // localhost:7180\nnew Raito('raito://localhost:9180'); // localhost:9180\nnew Raito('raito://localhost:9180?ttl=5000'); // localhost:9180 and ttl 5s\nnew Raito({\n  port: 9180,\n  host: 'localhost',\n  ttl: 10000, // Cache records time to live\n  password: 'superpass123', \n});\n```\n\n### Usage\n\n**Raito class**\n```typescript\nimport { Raito } from '@raito-cache/client';\n\nconst raito = new Raito();\n\nawait raito.set('key', { data: 'some data' }); // Create new record\nawait raito.set('key2', 'other data', 15000); // Create new record with 15s ttl\n\nawait raito.get('key2'); // Output: { key: 'key', data: 'other data', createdAt: Date, ttl: 15000 }\nawait raito.clear('key'); // Deletes record\n\nawait raito.shutdown(); // Close connection\n```\n\n## Raito Deployment\n1. Pull docker image:\n  ```shell\n  $ docker pull stbestich/raito-cache:latest_amd64\n  ```\n2. Run it\n  ```shell\n  $ docker run -e HOST=\u003chost\u003e -p \u003cport\u003e:9180 -it stbestich/raito-cache\n  ```\n\n#### Use with docker-compose\n```yaml\nservices:\n  raito-cache:\n    image: stbestich/raito-cache:latest\n    ports:\n      - \"${PORT:-9180}:${PORT:-9180}\"\n      - \"${PORT:-9181}:${PORT:-9181\" # Define second port if you need http proxy\n    env_file:\n      - .env\n    environment:\n      NODE_ENV: production\n      PORT: ${PORT:-9180}\n      HOST: ${HOST:-0.0.0.0}\n      TTL: ${TTL}\n      PASSWORD: ${PASSWORD}\n    tty: true\n    stdin_open: true\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Changelog\n\nProject changes are writen in changelog, see the [CHANGELOG.md](CHANGELOG.md).\n\nWe use [SemVer](https://semver.org/) for versioning.\nFor the versions available, see the [tags](https://github.com/stbestichhh/raito-client/tags) on this repository.\nFor the versions supported, see the [SECURITY.md](SECURITY.md).\n\n## Authors\n\n- [@stbestichhh](https://www.github.com/stbestichhh)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraito-cache-server%2Fraito-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraito-cache-server%2Fraito-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraito-cache-server%2Fraito-client/lists"}