Skip to content

Commit

Permalink
release 0.3.0 browser support, universal json docs
Browse files Browse the repository at this point in the history
  • Loading branch information
colinskow committed May 9, 2016
1 parent efd98ad commit 00baa0d
Show file tree
Hide file tree
Showing 11 changed files with 1,184 additions and 29 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2013 by Maciej Małecki, portions (C) 2014 by Colin Skow
Copyright (C) 2013 by Maciej Małecki, portions (C) 2014-2016 by Colin Skow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install pouchdb-seed-design

```js
var PouchDB = require('pouchdb');
var seed = require('pouchdb-seed-design');
var pouchSeed = require('pouchdb-seed-design');
var db = new PouchDB('http://localhost:5984/design');

var ddoc = {
Expand All @@ -34,7 +34,7 @@ var ddoc = {
}
};

var promise = seed(db, ddoc).then(function(updated) {
var promise = pouchSeed(db, ddoc).then(function(updated) {
if(updated) {
console.log('DDocs updated!');
} else {
Expand All @@ -45,7 +45,7 @@ var promise = seed(db, ddoc).then(function(updated) {

## API

### `pouchdb-seed-design(db, design, cb)`
### `pouchSeed(db, design, cb)`

* `db` (`object`, required) - `PouchDB` (or compatible) database object
* `design` (`object`, required) - design object
Expand All @@ -57,6 +57,8 @@ If no changes between remote design documents and `design` object are detected,

Seed will return a Promise that fulfills with `false` if no updates were necessary, or the result of the `bulkDocs` operation if changes were pushed. (You will need a `Promise` shim if you are using an older browser or version of Node.)

The browser version will export `window.pouchSeed`.

## Updates

##### (0.3.0) 2016-05-08
Expand Down
21 changes: 21 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "pouchdb-seed-design",
"description": "Seed CouchDB's design documents with PouchDB",
"version": "0.3.0",
"author": "Colin Skow",
"license": "MIT",
"homepage": "http://github.com/colinskow/pouchdb-seed-design",
"repository": {
"type": "git",
"url": "git://github.com/colinskow/pouchdb-seed-design.git"
},
"main": ["dist/pouchdb-seed-design.js"],
"keywords": [
"PouchDB",
"CouchDB",
"seed",
"design docs"
],
"dependencies": {},
"devDependencies": {}
}
Loading

0 comments on commit 00baa0d

Please sign in to comment.