This package has been deprecated

Author message:

This package has been deprecated and is no longer maintained. Please use @varasto/remote-storage.

varasto-client
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

varasto-client

Node.js client library for Varasto JSON key-value store. Uses axios for connecting to the server.

Installation

$ npm install --save varasto-client

Usage

The libary exports single class, Client, which when instantiated can be used to connect to Varasto server. Constructor of Client class takes an optional configuration object, which supports these settings:

Property Default value Description
hostname 0.0.0.0 Hostname of the server to which to connect to.
port 3000 Port of the server to which to connect to.
secure false   Whether HTTPS should be used or not.
auth Username and password for basic authentication.

Storing items

setItem(key: string, value: Object): Promise<void>

Attempts to connect to the server and store an item identified by key.

Retrieving items

getItem(key: string): Promise<Object|undefined>

Attempts to connect to the server and retrieve an item identified by key. Returned promise will resolve into value of the item, or undefined if the item does not exist.

Removing items

removeItem(key: string): Promise<Object|undefined>

Attempts to connect to the server and remove an item identified by key. Returned promise will resolve into value of the removed item, or undefined if the item does not exist.

Updating items

updateItem(key: string, value): Promise<Object|undefined>

Attempts to connect to the server and perform an partial update to an item identified by key. Returned promise will resolve into value of the updated item after the update, or undefined if the item does not exist.

Readme

Keywords

none

Package Sidebar

Install

npm i varasto-client

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

5.98 kB

Total Files

5

Last publish

Collaborators

  • rauli