New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dht-keyvalue

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dht-keyvalue - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "dht-keyvalue",
"version": "1.0.4",
"version": "1.0.5",
"description": "Store key-value pairs on the mainline bittorrent DHT network, and retreive/update them by key name.",

@@ -5,0 +5,0 @@ "main": "server.js",

@@ -34,13 +34,15 @@ # dht-keyvalue

## `dkv.put([items], [callback])`
`items` is an array of items with the following structure:
### `dkv.put([items], [callback])`
Put a record or multiple records on DHT. `items` is an array of items with the following structure:
```js
[ { key: 'keyname', value: 'value' }, { ... }, { ... } ]
```
`callback` returns the DHT `hash` of the announced item and its `key` name.
## `dkv.get(key, [callback])`
Lookup an item stored on DHT. `callback` returns the item's `key` name and `value`.
### `dkv.get(key, [callback])`
Get an item stored on DHT by `key`. `callback` returns the item's `key` name and the DHT object's `value`.
## `dkv.update(key, newValue, [callback])`
### `dkv.update(key, newValue, [callback])`
Update an item in DHT by key name. `callback` returns `true` when the update on DHT was successful.

@@ -51,3 +53,3 @@

## Examples
### Put, get, update one record on DHT
### One record: put, get, update on DHT
```js

@@ -78,3 +80,3 @@ let item = [

```
### Put, get, update multiple records on DHT
### Multiple records: put, get, update on DHT
```js

@@ -81,0 +83,0 @@ let items = [

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