Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

brokoli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brokoli

client for fiware orion context broker

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

brokoli

Brokoli is a client for Orion Context Broker It uses Orion Context Broker as data storage and works around it's stupid design decisions.

intall

npm install brokoli

example


var brokoli = require("brokoli");

var client = brokoli({
	url: "http://user:password@localhost:1026/v1/",
	auth_token: ""
});

// create an entity
client.save(1, {
	bla: "fasel", 
	blub: 1,
	foo: "bar <= baz"
}, function(err, result){
	if (err) return console.log(err);
});

usage

brokoli(opts)

Create an instance of brokoli. Opts may contain

{
	"url": "https://127.0.0.1:1026/v1/",  // base url of orion context broker
	"auth_token": "<auth token>",         // auth token, if needed
	"type": "whatever",                   // global entity type
	"strictssl": true                     // obey/ignore ssl warnings
}

brokoli.save(id, data, fn(err, result))

Save an entity. id is an identifier, data is a key/value object.

brokoli.delete(id, fn(err))

Delete an entity by id.

brokoli.get(id, fn(err, entity))

Get an entity by id:

{
	"id": "<id>",
	"data": {
		"foo": "bar",
		"bla": "fasel",
		"blub": 1
	}
}

brokoli.fetch(fn(err, entities))

Retrieve all entities:

[{
	"id": "<id>",
	"data": {
		"foo": "bar",
		"bla": "fasel",
		"blub": 1
	}
},{
	...
}]

Keywords

context

FAQs

Package last updated on 23 Apr 2015

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