Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iomem

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iomem - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

17

CHANGELOG.md
# Changelog
## [1.4.0](https://github.com/alexzel/iomem/compare/v1.3.0...v1.4.0) (2023-01-29)
### ⚠ BREAKING CHANGES
* version and stat commands should return data by a hostname
### Bug Fixes
* make flush with expiry argument work properly ([9d63ee6](https://github.com/alexzel/iomem/commit/9d63ee64eb2592510db509bf337a5bba2a3ad5e2))
* version and stat commands should return data by a hostname ([a5206cd](https://github.com/alexzel/iomem/commit/a5206cd4e87bd4389af68bc682641820372e4d45))
### Miscellaneous Chores
* release 1.4.0 ([ccc4f4e](https://github.com/alexzel/iomem/commit/ccc4f4ef4c8ec735021ae41836c07ec16a09de8c))
## [1.3.0](https://github.com/alexzel/iomem/compare/v1.2.0...v1.3.0) (2023-01-26)

@@ -4,0 +21,0 @@

2

package.json
{
"name": "iomem",
"version": "1.3.0",
"version": "1.4.0",
"description": "Memcached client implementing binary protocol with native multiple keys support",

@@ -5,0 +5,0 @@ "keywords": [

@@ -239,10 +239,14 @@ # `iomem`

`flush()` - flush cached items.
`flush()` - flush cached items on all servers.
`flush(expiry)` - flush cached items in `expiry` seconds.
`flush(expiry)` - flush cached items on all servers in `expiry` seconds.
`quit()` - closes connection that query hits (either existing or a new one). Useless in multi-connection and multi-server environment.
`quit()` - closes connection that query hits (either existing or a new one) on all servers. Useless in multi-connection and multi-server environment.
`noop()` - sends empty packet and returns true on success, may be useful for pinging.
`noop()` - sends empty packet to all servers and returns true on success, may be useful for pinging.
### VERSION
`version(): {<hostname>: <version>, ...}` - get Memcached version string by a server hostname.
### APPEND AND PREPEND

@@ -284,7 +288,7 @@

Stat command requests server statistics. Without a key the stat command will return a default set of statistics information.
Stat command requests statistics from each server. Without a key the stat command will return a default set of statistics information by a server hostname'
`stat(): object` - get a default set of statistics information
`stat(): {<hostname>: object, ...}` - get a default set of statistics information by a server hostname.
`stat(key): object` - get statistics set specified by key (e.g. 'items', 'slabs', 'sizes', see [Memcached wiki](https://github.com/memcached/memcached/wiki/Commands#statistics))
`stat(key): {<hostname>: object, ...}` - get statistics specified with a key (e.g. 'items', 'slabs', 'sizes') by a server hostname, see [Memcached wiki](https://github.com/memcached/memcached/wiki/Commands#statistics).

@@ -291,0 +295,0 @@

@@ -95,3 +95,3 @@ 'use strict'

static flush (expiry) {
return ['flush', expiry]
return ['flush', null, expiry]
}

@@ -98,0 +98,0 @@

@@ -136,3 +136,3 @@ 'use strict'

if (protocol[method].format) {
protocol[method].format(packet, buffer)
protocol[method].format(packet, buffer, server)
}

@@ -139,0 +139,0 @@ } else if (packet[5] === STATUS_EXISTS) { // exists

@@ -133,3 +133,3 @@ 'use strict'

const flush = (expiry, opaque) =>
const flush = (_, expiry, opaque) =>
expiring(OPCODES.flush, DEFAULT_KEY, expiry, opaque)

@@ -145,4 +145,5 @@

(_, opaque) => [OPCODES.version, DEFAULT_KEY, DEFAULT_VALUE, DEFAULT_EXTRAS, DEFAULT_STATUS, DEFAULT_CAS, opaque],
(packet, buffer) => buffer.push(packet[3].toString()),
(keyFlags, buffer) => (buffer[0] || null)
(packet, buffer, server) => (buffer[server.hostname] = packet[3].toString()),
(keyFlags, buffer) => buffer,
true
)

@@ -176,3 +177,10 @@

(key, opaque) => [OPCODES.stat, key, DEFAULT_VALUE, DEFAULT_EXTRAS, DEFAULT_STATUS, DEFAULT_CAS, opaque],
(packet, buffer) => packet[2] && (buffer[packet[2]] = packet[3].toString()),
(packet, buffer, server) => {
if (!buffer[server.hostname]) {
buffer[server.hostname] = {}
}
if (packet[2]) {
buffer[server.hostname][packet[2]] = packet[3].toString()
}
},
(keyFlags, buffer, keysStat) => buffer,

@@ -179,0 +187,0 @@ true

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc