New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-app-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-app-client

node-app-client: Socket client for remote interaction with application server

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

node-app-client

Socket client for use with node-app-srv

Description

node-app-client is a socket client for use with node-app-srv. The JSON application socket service accepts connections from the client and allows interaction with a any number of custom node.js applications and/or databases.

Installation

npm install node-app-client

Usage

var appName = "test";
var appHost = "localhost";
var appPort = 10089;

var appClient = require('node-app-client').create(appName,appHost,appPort);

appClient.connect();

var userName = "admin";
var userPass = "admin";

function callback(response) {
	console.log("packet received: " + JSON.stringify(response));
}

/* authenticate client connection */
appClient.auth(callback,userName,userPass);

var db = "testdb";
var path = "path.to.object";

/* read a record from database */
appClient.read(callback,db,path);

Core methods

appClient.auth(callback,userName,userPass);
appClient.connect();
appClient.disconnect();

JSON-DB methods

/* record locking: see ./lib/defs.js for valid <lock> types */
appClient.lock(callback,db,path,lock);
appClient.read(callback,db,path);
appClient.write(callback,db,[{path:"path/to",key:"object",value:10},...]);
appClient.unlock(callback,db,path);

/* generic request: see ./lib/defs.js for valid <oper> types */
appClient.request(callback,db,oper,data)

/* clients subscribed to a path within an object receive an update of that object any time a change occurs */
appClient.subscribe(callback,db,path);
appClient.unsubscribe(callback,db,path);

JPath integration

node-jpath allows for xpath-style queries in a JSON environment.

Examples

/* return all path.to.property records where property == value */
appClient.read(callback,db,"path.to[property==value]");

/* return all records with child 'property' containing a child 'value' > 10 */
appClient.read(callback,db,"*.property[value>10]");

See node-jpath for more examples

Keywords

utility

FAQs

Package last updated on 19 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts