To install PouchDB using jspm:
jspm install pouchdb=npm:pouchdb
then import:
import PouchDB from 'pouchdb';
<!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>
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);
{
"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"
}
}
}