Skip to content

Commit

Permalink
Node: fix docs (#2346)
Browse files Browse the repository at this point in the history
* Node: fix docs

Signed-off-by: Adar Ovadia <[email protected]>

* fix readme

Signed-off-by: Adar Ovadia <[email protected]>

* Node: add readme examples

Signed-off-by: Adar Ovadia <[email protected]>

---------

Signed-off-by: Adar Ovadia <[email protected]>
Co-authored-by: Adar Ovadia <[email protected]>
  • Loading branch information
adarovadya and Adar Ovadia authored Sep 23, 2024
1 parent 0cff921 commit 44ec72b
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 55 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ Valkey General Language Independent Driver for the Enterprise (GLIDE), is an ope
## Supported Engine Versions
Valkey GLIDE is API-compatible with the following engine versions:

| Engine Type | 6.2 | 7.0 | 7.2 |
|-----------------------|-------|-------|-------|
| Valkey | - | - | V |
| Redis | V | V | V |
| Engine Type | 6.2 | 7.0 | 7.2 | 8.0 |
|-----------------------|-------|-------|-------|-------|
| Valkey | - | - | V | V |
| Redis | V | V | V | - |

## Current Status
In this release, Valkey GLIDE is available for Python and Java. Support for Node.js is actively under development, with plans to include more programming languages in the future. We're tracking future features on the [roadmap](https://github.com/orgs/valkey-io/projects/11).
In this release, Valkey GLIDE is available for Python, Java and Node.js. Support for GO is actively under development, with plans to include more programming languages in the future. We're tracking future features on the [roadmap](https://github.com/orgs/valkey-io/projects/11).

## Getting Started
- [Java](./java/README.md)
- [Python](./python/README.md)
- [Node](./node/README.md)
- [Documentation](https://github.com/valkey-io/valkey-glide/wiki)

## Getting Help
Expand Down
38 changes: 0 additions & 38 deletions csharp/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions examples/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { GlideClient, GlideClusterClient, Logger } from "@valkey/valkey-glide";

async function sendPingToStandAloneNode() {
// When in Redis is in standalone mode, add address of the primary node, and any replicas you'd like to be able to read from.
// When Valkey is in standalone mode, add address of the primary node, and any replicas you'd like to be able to read from.
const addresses = [
{
host: "localhost",
Expand Down Expand Up @@ -34,7 +34,7 @@ async function send_set_and_get(client: GlideClient | GlideClusterClient) {
}

async function sendPingToRandomNodeInCluster() {
// When in Redis is cluster mode, add address of any nodes, and the client will find all nodes in the cluster.
// When Valkey is in cluster mode, add address of any nodes, and the client will find all nodes in the cluster.
const addresses = [
{
host: "localhost",
Expand Down
2 changes: 1 addition & 1 deletion java/client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ publishing {
}
developers {
developer {
name = 'valkey-glide'
name = 'Valkey GLIDE Maintainers'
url = 'https://github.com/valkey-io/valkey-glide.git'
}
}
Expand Down
73 changes: 67 additions & 6 deletions node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ Valkey General Language Independent Driver for the Enterprise (GLIDE), is an ope

Refer to the [Supported Engine Versions table](https://github.com/valkey-io/valkey-glide/blob/main/README.md#supported-engine-versions) for details.

## Current Status

We've made Valkey GLIDE an open-source project, and are releasing it in Preview to the community to gather feedback, and actively collaborate on the project roadmap. We welcome questions and contributions from all Redis stakeholders.
This preview release is recommended for testing purposes only.

# Getting Started - Node Wrapper

## System Requirements

In this release, Valkey GLIDE is available for Python and Java. Support for Node.js is actively under development, with plans to include more programming languages in the future. We're tracking future features on the [roadmap](https://github.com/orgs/aws/projects/187/).
The release of Valkey GLIDE was tested on the following platforms:

Linux:

- Ubuntu 22.04.1 (x86_64)
- Amazon Linux 2023 (AL2023) (x86_64)

macOS:

- macOS 12.7 (Apple silicon/aarch_64 and Intel/x86_64)

## NodeJS supported version

Expand All @@ -29,6 +33,63 @@ Visit our [wiki](https://github.com/valkey-io/valkey-glide/wiki/NodeJS-wrapper)

Development instructions for local building & testing the package are in the [DEVELOPER.md](https://github.com/valkey-io/valkey-glide/blob/main/node/DEVELOPER.md#build-from-source) file.

## Basic Examples

#### Standalone Mode:

```typescript
import { GlideClient, GlideClusterClient, Logger } from "@valkey/valkey-glide";
// When Valkey is in standalone mode, add address of the primary node, and any replicas you'd like to be able to read from.
const addresses = [
{
host: "localhost",
port: 6379,
},
];
// Check `GlideClientConfiguration/GlideClusterClientConfiguration` for additional options.
const client = await GlideClient.createClient({
addresses: addresses,
// if the server uses TLS, you'll need to enable it. Otherwise, the connection attempt will time out silently.
// useTLS: true,
clientName: "test_standalone_client",
});
// The empty array signifies that there are no additional arguments.
const pong = await client.customCommand(["PING"]);
console.log(pong);
const set_response = await client.set("foo", "bar");
console.log(`Set response is = ${set_response}`);
const get_response = await client.get("foo");
console.log(`Get response is = ${get_response}`);
```

#### Cluster Mode:

```typescript
import { GlideClient, GlideClusterClient, Logger } from "@valkey/valkey-glide";
// When Valkey is in cluster mode, add address of any nodes, and the client will find all nodes in the cluster.
const addresses = [
{
host: "localhost",
port: 6379,
},
];
// Check `GlideClientConfiguration/GlideClusterClientConfiguration` for additional options.
const client = await GlideClusterClient.createClient({
addresses: addresses,
// if the cluster nodes use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
// useTLS: true,
clientName: "test_cluster_client",
});
// The empty array signifies that there are no additional arguments.
const pong = await client.customCommand(["PING"], { route: "randomNode" });
console.log(pong);
const set_response = await client.set("foo", "bar");
console.log(`Set response is = ${set_response}`);
const get_response = await client.get("foo");
console.log(`Get response is = ${get_response}`);
client.close();
```

### Supported platforms

Currentlly the package is supported on:
Expand Down
4 changes: 2 additions & 2 deletions node/npm/glide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "${scope}${pkg_name}",
"types": "build-ts/index.d.ts",
"version": "${package_version}",
"description": "An AWS-sponsored, open-source Redis client.",
"description": "General Language Independent Driver for the Enterprise (GLIDE) for Valkey",
"main": "build-ts/index.js",
"module": "build-ts/index.js",
"type": "commonjs",
Expand All @@ -26,7 +26,7 @@
"client",
"valkey-glide"
],
"author": "Amazon Web Services",
"author": "Valkey GLIDE Maintainers",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/valkey-io/valkey-glide/issues"
Expand Down
2 changes: 1 addition & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"typescript": "^5.5.4",
"uuid": "^10.0.0"
},
"author": "Valkey contributors",
"author": "Valkey GLIDE Maintainers",
"license": "Apache-2.0",
"publishConfig": {
"${registry_scope}registry": "https://registry.npmjs.org/",
Expand Down

0 comments on commit 44ec72b

Please sign in to comment.