From ea050398c3b1353ae3dc157d1f818daa1c1f0a07 Mon Sep 17 00:00:00 2001 From: Simon Prickett Date: Tue, 19 Oct 2021 20:04:21 +0100 Subject: [PATCH 1/2] Updated examples to user named functions. --- examples/README.md | 2 +- examples/connect-as-acl-user.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/README.md b/examples/README.md index d1e3b73a054..d41fd4a486c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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(); diff --git a/examples/connect-as-acl-user.js b/examples/connect-as-acl-user.js index 20e3c4c3caf..26e1e443b0a 100644 --- a/examples/connect-as-acl-user.js +++ b/examples/connect-as-acl-user.js @@ -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(); - From 4a09805dc2c49d71167bed19ad7b157ee70f3d16 Mon Sep 17 00:00:00 2001 From: Leibale Eidelman Date: Tue, 19 Oct 2021 16:12:08 -0400 Subject: [PATCH 2/2] Update README.md --- examples/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/README.md b/examples/README.md index d41fd4a486c..25b87683330 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,9 +2,9 @@ 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| +| 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'; -async function doSomething () { +async function doSomething() { const client = createClient(); await client.connect(); @@ -55,6 +55,5 @@ async function doSomething () { await client.quit(); } - doSomething(); -``` \ No newline at end of file +```