1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Updated examples to use named functions. (#1687)

* Updated examples to user named functions.

* Update README.md

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
This commit is contained in:
Simon Prickett
2021-10-19 21:13:35 +01:00
committed by GitHub
parent a5eb16595f
commit 46aad787eb
2 changed files with 6 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
This folder contains example scripts showing how to use Node Redis in different scenarios.
| File Name | Description |
|------------------------|------------------------------------|
|--------------------------|--------------------------------------|
| `connect-as-acl-user.js` | Connect to Redis 6 using an ACL user |
## Contributing
@@ -45,7 +45,7 @@ Here's a starter template for adding a new example, imagine this is stored in `d
import { createClient } from 'redis';
const doSomething = async () => {
async function doSomething() {
const client = createClient();
await client.connect();
@@ -55,6 +55,5 @@ const doSomething = async () => {
await client.quit();
}
doSomething();
```

View File

@@ -7,7 +7,7 @@
import { createClient } from 'redis';
const connectWithACLUser = async () => {
async function connectWithACLUser() {
const client = createClient({
url: 'redis://testuser:testpassword@127.0.0.1:6379'
});
@@ -27,6 +27,4 @@ const connectWithACLUser = async () => {
await client.quit();
}
connectWithACLUser();