From d41643678e31ca965403162ae1610c24995d41da Mon Sep 17 00:00:00 2001 From: Josh Betz Date: Fri, 1 Nov 2024 17:29:43 -0500 Subject: [PATCH] syntax highlighting in the readme --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2b1f9d2..2b09c41 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ There are three libraries exported from this package. -``` +```javascript const { Memcached, Pool, HashPool } = require( '@joshbetz/memcached' ); ``` @@ -10,49 +10,49 @@ const { Memcached, Pool, HashPool } = require( '@joshbetz/memcached' ); The API for all three libraries is the same. It just depends what kind of connection and failover logic you need. -``` +```javascript async ready() ``` Wait for the connection to be ready. -``` +```javascript async flush() ``` Flush the Memcached data. -``` +```javascript async set( key, value, ttl ): Boolean ``` SETs a given key and value for the specified TTL (or no TTL). Returns a Boolean to indicate whether the operation was successful. -``` +```javascript async add( key, value, ttl ): Boolean ``` ADDs a given key and value for the specified TTL (or no TTL) if it doesn't already exist. Returns a Boolean to indicate whether the operation was successful. -``` +```javascript async get( key ): string|Boolean ``` GETs a given key. Returns `false` if it does not exist. -``` +```javascript async del( key ): Boolean ``` DELETEs a given key. -``` +```javascript async ping(): Boolean ``` Sends the version command. Returns `true` if the expected response is returned. -``` +```javascript async end() ``` @@ -64,7 +64,7 @@ This is a simple Memcached library that connects to a Memcached server and execu ### Example -``` +```javascript const opts = { prefix: '', socketTimeout: 100, @@ -87,7 +87,7 @@ This is a wrapper around our Memcached library that establishes a connection poo ### Example -``` +```javascript const opts = { // Pool options max: 10, @@ -124,7 +124,7 @@ This is a wrapper around our Pool library that establishes connection pools to e ### Example -``` +```javascript const opts = { retry: ( retries: number ): number => { const exp = Math.pow( 2, retries ) * 250;