{"id":28385392,"url":"https://github.com/infinispan/js-client","last_synced_at":"2025-06-26T06:32:07.499Z","repository":{"id":37851380,"uuid":"47264708","full_name":"infinispan/js-client","owner":"infinispan","description":"Javascript client for Infinispan, over the Hot Rod wire protocol","archived":false,"fork":false,"pushed_at":"2025-05-21T09:08:04.000Z","size":794,"stargazers_count":16,"open_issues_count":2,"forks_count":28,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-06-04T09:06:27.197Z","etag":null,"topics":["hotrod-client","infinispan","javascript","javascript-client","js-client","nodejs"],"latest_commit_sha":null,"homepage":"https://infinispan.org/docs/hotrod-clients/js/latest/js_client.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infinispan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-12-02T14:01:23.000Z","updated_at":"2025-05-21T09:07:02.000Z","dependencies_parsed_at":"2024-09-27T00:33:02.190Z","dependency_job_id":"9f8239f7-7a1f-417d-8c50-52e5022d13dc","html_url":"https://github.com/infinispan/js-client","commit_stats":{"total_commits":263,"total_committers":24,"mean_commits":"10.958333333333334","dds":0.3916349809885932,"last_synced_commit":"8205b357eba7f3f835b40e71604756ddeea61d3e"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/infinispan/js-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinispan%2Fjs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinispan%2Fjs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinispan%2Fjs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinispan%2Fjs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinispan","download_url":"https://codeload.github.com/infinispan/js-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinispan%2Fjs-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260669534,"owners_count":23044296,"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":["hotrod-client","infinispan","javascript","javascript-client","js-client","nodejs"],"created_at":"2025-05-30T10:39:31.915Z","updated_at":"2025-06-26T06:32:07.487Z","avatar_url":"https://github.com/infinispan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hot Rod JS Client\n\n`infinispan` is an asynchronous event-driven Infinispan client for Node.js.\nThe results of the asynchronous operations are represented using\n[Promise](https://www.promisejs.org) instances. Amongst many advantages,\npromises make it easy to transform/chain multiple asynchronous invocations\nand they improve error handling by making it easy to centralise it.\n\nThe client is under heavy development but here's a summary of its\ncurrent capabilities:\n\n* `infinispan` client can be constructed with a single server address or\nmultiple servers addresses. When passing multiple addresses, it will iterate\nuntil it finds a server to which it can connect to.\n* Clients can interact with a named cache whose name is passed on client\nconstruction via `{cacheName: 'myCache'}` option. In the absence of any cache\nname options, the client will interact with the default cache.\n* Full CRUD operation support, e.g. `put`, `get`, `remove`, `containsKey`...etc.\n* Compare-And-Swap operation support, e.g. `putIfAbsent`,\n`getWithMetadata`, `replace`, `replaceWithVersion`,\n`removeWithVersion`..etc.\n* Expiration with absolute lifespan or relative maximum idle time\nis supported. This expiration parameters as passed as optional parameters\nto create/update methods and they support multiple time units, e.g.\n`{lifespan: '1m', maxIdle: '1d'}`.\n* Update and remove operations can optionally return previous values\nby passing in `{previous: true}` option.\n* Bulk store/retrieve/delete operations are supported, e.g. `putAll`, `getAll`,\n`clear`...etc.\n* Cache contents can be iterated over using the `iterator` method.\n* Cache size can be determined using the `size` method.\n* Remote cache listeners can be plugged using the `addListener` method, which\ntakes the event type (`create`, `modify`, `remove` or `expiry`) and the\nfunction callback as parameter.\n* Clients can store scripts using `addScript` and then they can be remotely\nexecuted using the `execute` operation. Executing a script remotely\noptionally takes per-invocation parameters.\n* Server-side statistics can be retrieved using the `stats` operation.\n* Clients can connect using encryption with the server via SSL/TLS with optional TLS/SNI support.\n* Clients can talk to clusters of Infinispan Server instances, using\nConsistent-Hash based algorithms to route key-based operations.\n* Multi-key or key-less operations are routed in round-robin fashion.\n* Clients only need to be configure with a single node's address and from\nthat node the rest of the cluster topology can be discovered. As nodes are\nadded or destroyed, clients get notified of changes in the cluster topology\ndynamically.\n* Clients can talk to multiple clusters that are separated into different site clusters.\nThe client is normally connected to one of the sites, but if its members fail to respond, it will automatically switch to an alternative site to which it can connect.\n* Clients have methods, such as `switchToCluster(clusterName)` and `switchToDefaultCluster` that allows users to manually change to which site cluster to connect.\n* Finally, clients can stop communication with the server(s) using the\n`disconnect` method.\n\n# Hot Rod JS client documentation\n\nFind installation, configuration, and example usage in the Hot Rod JS Client Guide at [infinispan.org/documentation](https://infinispan.org/documentation/).\n\nYou can also build the Hot Rod JS Client Guide as follows:\n\n1. Clone the source repository.\n```bash\n$ git clone git@github.com:infinispan/js-client.git\n```\n\n2. Build the HTML from the asciidoc source.\n```bash\n$ asciidoctor documentation/asciidoc/titles/js_client.asciidoc\n```\n\n3. Open `documentation/asciidoc/titles/js_client.html` in any browser.\n\n# API docs\n\nReview [Hot Rod JS client API documentation](http://docs.jboss.org/infinispan/hotrod-clients/javascript/1.0/apidocs/module-infinispan.html).\n\nYou can also build API docs from the source repository as follows:\n\n1. Generate JSDoc formatted API docs.\n```bash\n$ npm install jsdoc\n$ ./node_modules/.bin/jsdoc lib/*.js\n```\n\n2. Open `open out/index.html` in any browser.\n\n# Testing\n\nBefore executing any tests, Infinispan Server instances need to be started\nup so that testsuite can run against those. To ease this process, a script\nhas been created in the root directory to start all the expected server\ninstances.\n\nGo to the root of the repo and execute:\n\n```bash\n$ npm install\n```\n\nNext, start the Infinispan Servers via:\n\n```bash\n$ ./run-servers.sh\n```\n\nTo run the testsuite once execute:\n\n```bash\n$ ./run-testsuite.sh\n```\n\nTo run tests continuously execute:\n\n```bash\n$ ./node_modules/.bin/jasmine-node spec --autotest --watch lib --captureExceptions\n```\n\nTo run individual tests execute:\n\n```bash\n$ node node_modules/jasmine-node/lib/jasmine-node/cli.js spec/infinispan_local_spec.js --captureExceptions\n```\n\nTo help with testing, you can quickly run the smoke tests via:\n\n```bash\n$ ./smoke-tests.sh\n```\n\nBoth testsuite and smoke tests can be run with older protocol versions, e.g.\n\n```bash\n$ protocol=2.5 ./smoke-tests.sh\n```\n\n## Note for Mac Users:\nYou might experience MPING issues running an Infinispan cluster.\n\n```bash\n13:37:15,561 ERROR (jgroups-5,server-two) [org.jgroups.protocols.MPING]\n```\n\nIf you run into the errors above, add the following to the routes of your host\n\n```bash\nsudo route add -net 224.0.0.0/5 127.0.0.1\nsudo route add -net 232.0.0.0/5 192.168.1.3\n```\n\n# Manual stress tests\n\nThe testsuite now contains manual stress tests that take several minutes to run.\nTo run these tests, execute:\n\n    $ ./node_modules/.bin/jasmine-node spec-manual --captureExceptions\n\n\n# Memory profiling\n\nThe source code comes with some programs that allow the client's memory consumption to be profiled.\nThose programs rely on having access to the global garbage collector.\nSo, to run them you must pass `--expose-gc` command line parameter.\nExample:\n\n```bash\nnode --expose-gc memory-profiling/infinispan_memory_many_get.js\n```\n\nSo of programs might only report the memory usage before/after.\nOthers might generate heap dumps which can be visualized using Google Chrome.\nWithin Chrome, the Developer Tools UI contains a `Memory` tab where heap dumps can be loaded.\n\n\n# Debugging\n\nTo debug tests with IDE:\n\n    node --inspect-brk node_modules/jasmine-node/lib/jasmine-node/cli.js spec/codec_spec.js\n\nOr:\n\n    node --inspect-brk node_modules/jasmine-node/lib/jasmine-node/cli.js spec/infinispan_local_spec.js\n\nAnd then start a remote Node.js debugger from IDE on port 9229.\n\n# Tests, servers and ports\n\nHere's some more detailed information on which tests interact with which servers and on which ports.\nOn top of that, you can find information on which tests are always running as opposed to those that are started (and stopped) by the tests themselves.\n\n| Test          | Server Profile  | Ports (Auto/Manual)                     |\n| :------------ | :-------------: | :-------------------------------------- |\n| local spec    | local           | `11222` (A)                             |\n| expiry spec   | local           | `11222` (A)                             |\n| cluster spec  | clustered       | `11322` (A), `11332` (A), `11342` (A)   |\n| failover spec | clustered       | `11422` (M), `11432` (M), `11442` (M)   |\n| ssl spec      | local           | `11232` (A), `12242` (A), `12252` (A)   |\n| xsite spec    | earth, moon     | `11522` (earth, M), `11532` (moon, M)   |\n\n# Reporting an issue\n\nThis project does not use Github issues.\nInstead, please report them via JIRA (project [HRJS](https://issues.jboss.org/projects/HRJS/summary)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinispan%2Fjs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinispan%2Fjs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinispan%2Fjs-client/lists"}