block by Hypercubed d3671f30905adafd3c9c

PoauchDB test

Full Screen

To install PouchDB using jspm:

jspm install pouchdb=npm:pouchdb

then import:

import PouchDB from 'pouchdb';

index.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>pouchdb test</title>
</head>

<body>

	<h1>pouchdb test</h1>

  <script src="jspm_packages/system.js"></script>
  <script src="config.js"></script>
  <script>
    System.import('main.js');
  </script>

</body>
</html>

main.js

import PouchDB from 'pouchdb';

var db = new PouchDB('dbname');

db.put({
  _id: 'dave@gmail.com',
  name: 'David',
  age: 68
});

db.changes().on('change', function(change) {
  console.log('Ch-Ch-Changes', change);
});

console.log('my-db', db);

package.json

{
  "jspm": {
    "dependencies": {
      "pouchdb": "npm:pouchdb@^5.0.0"
    },
    "devDependencies": {
      "traceur": "github:jmcriffey/bower-traceur@0.0.91",
      "traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.91"
    }
  }
}