{"id":28420622,"url":"https://github.com/redhat-developer/rsp-client","last_synced_at":"2025-06-26T16:32:05.915Z","repository":{"id":40790840,"uuid":"133797844","full_name":"redhat-developer/rsp-client","owner":"redhat-developer","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-24T17:50:27.000Z","size":385,"stargazers_count":5,"open_issues_count":15,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-05T05:29:07.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/redhat-developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-17T10:29:50.000Z","updated_at":"2022-01-13T15:43:18.000Z","dependencies_parsed_at":"2023-08-22T05:25:24.843Z","dependency_job_id":null,"html_url":"https://github.com/redhat-developer/rsp-client","commit_stats":{"total_commits":110,"total_committers":13,"mean_commits":8.461538461538462,"dds":0.7181818181818183,"last_synced_commit":"16e08dd6b84c0eeab915d9db0bd22ed508af1d63"},"previous_names":["sudhirverma/ssp-client"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-developer/rsp-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Frsp-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Frsp-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Frsp-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Frsp-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-developer","download_url":"https://codeload.github.com/redhat-developer/rsp-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer%2Frsp-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262102399,"owners_count":23259248,"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":[],"created_at":"2025-06-05T03:48:54.008Z","updated_at":"2025-06-26T16:32:05.899Z","avatar_url":"https://github.com/redhat-developer.png","language":"TypeScript","readme":"# rsp-client\n[![Build Status](https://travis-ci.org/redhat-developer/rsp-client.svg?branch=master)](https://travis-ci.org/redhat-developer/rsp-client)\n[![NPM version](https://img.shields.io/npm/v/rsp-client.svg)](https://www.npmjs.com/package/rsp-client)\n\nA simple client for the Runtime Server Protocol (RSP) written in typescript.\n\nImplements the API described [here](https://github.com/redhat-developer/rsp-server/blob/master/api/src/main/java/org/jboss/tools/rsp/api/RSPClient.java) and [here](https://github.com/redhat-developer/rsp-server/blob/master/api/src/main/java/org/jboss/tools/rsp/api/RSPServer.java).\n\nSee the [RSP repo](https://github.com/redhat-developer/rsp-server) for further details about RSP.\n\n## Installing\n\n```sh\nnpm i rsp-client\n```\n\n## Usage\nBasic \"short\" usage example, for full list of available methods, see [usage](USAGE.md).\n\n```typescript\nimport { RSPClient, Protocol, ServerState } from \"rsp-client\";\n\n// Use the host and port your RSP server is running on\nconst client = new RSPClient('localhost', 27511);\n\n// Initiate the connection\nawait client.connect();\n\n// Find suitable server in a directory and use the serverBeans to create a server called myServer\nconst serverBeans = await client.findServerBeans('path/to/your/server/root');\nconst serverHandle = await client.createServerSync(serverBeans[0], 'myServer');\n\n// Alternatively, one can create a server directly from a path\nconst handle = await client.createServerSync('path/to/server', 'server');\n\n// All 'sync' methods have an async alternative, in order to see when it completes, subscribe to the appropriate event\nclient.onServerAdded((handle) =\u003e {\n    console.log(`Server ${handle.id} created`);\n});\nawait client.createServerAsync('path/to/server', 'server');\n\n// Starting a server:\n// subscribe to the server producing output\nclient.onServerOutputAppended((output) =\u003e {\n    console.log(output.text);\n});\n\n// subscribe to server state changes to see when it started/stopped\nclient.onServerStateChange((state) =\u003e {\n    console.log(`Server state code is ${state.state}`);\n    if (state.state === ServerState.STARTED) {\n        console.log('Server started');\n    } else if (state.state === ServerState.STOPPED) {\n        console.log('Server stopped');\n    }\n});\n\n// get the starting parameters, we are using the normal run mode here\nconst attributes = await client.getServerRequiredLaunchAttributes({id: handle.id, mode: 'run'});\nconst params: Protocol.LaunchParameters = {\n    mode: 'run',\n    params: {\n        id: handle.id,\n        serverType: handle.type.id,\n        attributes: attributes\n    }\n};\n\n// finally start the server\nawait client.startServerAsync(params);\n\n// Stopping a server, use force at your will\nawait client.stopServerAsync({ id: handle.id, force: false });\n\n// When all is done you can disconnect the client\nclient.disconnect();\n// or even shut down the entire RSP server instead - don't use disconnect in this case\nclient.shutdownServer();\n```\n\n## Running unit tests\n\nUnit tests are located in `test`. To run all unit tests:\n\n```\nnpm run test\n```\n\n## publish\n\nTo publish our module, run the command\n\n```sh\nnpm publish\n```\n\n## Build \n\n```sh\nnpm run build\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer%2Frsp-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-developer%2Frsp-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer%2Frsp-client/lists"}