garden20 / garden-core

Small surface api to install, update and manage garden apps. Use in node, requirejs, and browser global.
0 stars 1 forks source link

Garden-Core

Small surface api to install, update and manage garden apps. Use in node, requirejs, and browser global.

Build Status

Install

npm install garden-core -g

Command-line

garden-core http://garden20.com/market/details/answers http://admin:secret@localhost:5984

Node usage

var garden_core = require('garden-core');

garden_core.install('http://garden20.com/market/_db', 'bookmarks', 'http://localhost:5984/', 'bookmarks', function(err) {
    if (err) console.log('no bookmarks for you');
});

Jam (requirejs) Usage

jam install garden-code

require(['garden-core'], function(garden_core) {
    garden_core.install('http://garden20.com/market/_db', 'bookmarks', 'http://localhost:5984/', 'bookmarks', function(err) {
        if (err) console.log('no bookmarks for you');
    });
})

Browser Global

  <script src="https://github.com/garden20/garden-core/raw/master/assets/async.min.js" type="text/javascript"></script>
  <script src="https://github.com/garden20/garden-core/raw/master/assets/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script src="https://github.com/garden20/garden-core/raw/master/assets/couchr-browser.js" type="text/javascript"></script>
  <script src="https://github.com/garden20/garden-core/raw/master/assets/url.js" type="text/javascript"></script>
  <script src="https://github.com/garden20/garden-core/raw/master/assets/garden-core.min.js" type="text/javascript"></script>
  <script>
    garden_core.install('http://garden20.com/market/_db', 'bookmarks', 'http://localhost:5984/', 'bookmarks', function(err) {
        if (err) console.log('no bookmarks for you');
    });
  </script>

API

install(src_db, doc_id, couch_root_url, db_name, options, callback);

Licenece: MIT