node package manager



PouchDB simplified by TypeScript Decorators

npm version Build Status Coverage Status Join the chat at

npm install pouchdb pouchable --save

Include the followings in your project

import * as PouchDB from 'pouchdb';
import { Entity, EntityField, Collection } from 'pouchable'

Declare your Entity

 * Posts 
class Post extends Entity {
        group: "default",
        name: "title",   
        mandatory: true,
        search_by: [ _.identity ] // need lodash
    title: string;
        group: "info",
        name: "author"
    author: string;
        group: "info",
        name: "content",
        validate: (v) => { return v.length < 140 } 
    content: string;

Declare your collection:

class Posts extends Collection<Post> {
    public getPrefix(): string {
        return "posts";

Pouchable and PouchDB at your service:

let db = new PouchDB("default");
let posts = new Posts(db, Post);
posts.insert({ title: "Pouchable is here!!!", author: "Joe"}).then((p) => {
   if (p.title != "Pouchable is here!!!") {
       throw new Error("not really hapenning...");
}).catch(() => {});

See it in action, our team example:

In this example, you will see a live, up-to-date code that is using pouchable and shows real usecases.

What API is available?

 posts.insert({ title: "Pouchable is here!!!", author: "Joe"}).then().catch(); 
 users.update(u, { street : "23 e 47th, New York, NY"} ).then().catch(); 
 users.find("title", "search title", { startsWith : true });

How Pouchable works under the hood?

![Image of Entity] (

Contributing to Pouchable

Contribution by pull requetsts is more than welcome, feel free to contact us

npm install
npm test

Topics to enhance

  • Change build to gulp
  • A simple web-site that will gather community around us
  • Schema documentation generation - see POC at
  • Search keys with multiple properties
  • Default value
  • Error handling when partial update happens