Socket
Socket
Sign inDemoInstall

couchdb-emily-tools

Package Overview
Dependencies
18
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    couchdb-emily-tools

Complete set of tools for synchronizing an observable key/value stores with CouchDB documents, views, and managing users or security documents. Works both in the browser and in node.js


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

#CouchDB-emily-tools

A set of tools to manage and secure CouchDB from an Emily/Olives app.

##To install and use the library on the server side only:

CouchDB-emily-tools requires Emily to work on the server side

npm install emily couchdb-emily-tools
var emily = require("emily"),
	tools = require("couchdb-emily-tools");

emily.handlers.set("CouchDB", tools.handler);

tools.requirejs(["CouchDBStore", "Transport"], function (CouchDBStore, Transport) {

	var cdb = new CouchDBStore,
		transport = new Transport(emily.handlers);

	cdb.setTransport(transport);

	cdb.sync("mydatabase", "mydocument")
	.then(function () {
		console.log(cdb.toJSON());
	}, function (error) {
		console.log(error);
	});
});

##To install and use the library on the client side:

CouchDB-emily-tools requires Olives to work on the client side. Olives embedds Emily for you. It also expects you to have socket.io installed, and a store for storing sessions, like redis store. In future implementations, redis store will probably be optional and an adapter will be accepted to any other store. An example can be found in the suggestions application

npm install olives couchdb-emily-tools
var olives = require("olives"),
	tools = require("couchdb-emily-tools");

// sessionStore can be a new RedisStore for instance
CouchDBTools.configuration.sessionStore = sessionStore;

// Add the CouchDB handler to Olives
olives.handlers.set("CouchDB", tools.handler);

And on the client side:

<scirpt src="requirejs.js" />
<script src="/socket.io/socket.io.js" />
<script src="Emily.js" />
<script src="Olives.js" />
<script src="CouchDBTools.js" />
requirejs(["CouchDBStore", "SocketIOTransport"], function (CouchDBStore, SocketIOTransport) {

	var socket = io.connect("http://localhost"),
		cdb = new CouchDBStore,
		transport = new SocketIOTransport(socket);

	cdb.setTransport(transport);

	cdb.sync("mydatabase", "mydocument")
	.then(function () {
		console.log(cdb.toJSON());
	});
});

Changelog

###1.0.5 - 25 MAR 2014

  • Removed specific code imported from another application after 1.0.2
  • Updated documentation

###1.0.3 - 11 MAR 2013

  • Updated emily + requirejs

###1.0.2 - 01 JAN 2013

  • Now using Emily 1.3.1 promises wich are fully compliant with promise/A+ specs
  • Moved Emily's CouchDB handler to CouchDB Emily Tools
  • Updated tests

###1.0.1 - 08 OCT 2012

  • CouchDBStore Views are compatible with couchdb-lucene's

###1.0.0 - 07 OCT 2012

  • CouchDBStore was removed from Emily and added to CouchDB-Emily-Tools.
  • It's now a library by itself, as it concentrates more work than the rest of Emily.

Keywords

FAQs

Last updated on 25 Mar 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc