0.0.21 • Published 3 years ago

@npmineral/flouch v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

flouch

Awesome Badges Awesome Badges PouchDB Logo

Maintained License

Watch on GitHubStar on GitHub

Introduction

Initialize your pouchdb databases easily with a configuration file

Currently runs with:

  • pouchdb v7.2.2
  • pouchorm v1.3.0

With this lib, you can :

  • Easily configure pouchdb databases
  • Create it with the cli command

Getting Started

Install library using :

npm i @npmineral/flouch

Configuration file

You can setup your configuration in several ways :

  • in flouch.config.js or flouch.config.ts
  • in package.json under flouch key
  • indicate the config file path when running the program
 flouch --config "path-to-file"

Usage

Set your configuration file with those attributes :

interface IDatabaseConfiguration {
  id?: string;
  name?: string;
  url?: string;
  protocol?: string;
  hostname?: string;
  port?: string | number;
  username?: string;
  password?: string;
  type?: POUCH_DB_TYPE;
}

Create a config file in a terminal window

cat > flouch.config.js

Database types

It is possible to create all pouchdb database types

  • IndexedDB
  • WebSQL
  • HTTP (CouchDB)
  • LevelDB

Using one a these type

enum POUCH_DB_TYPE {
  HTTP,
  LEVEL,
  INDEXED,
  WEBSQL,
}

Note: you can create local or remote databases.

Local

You have to indicate at least the name attribute

Remote

You have to indicate at least the url attribute or all others. If you indicate both url and others, others will be considered For example :

{
  "url": "http://db-hostname:5984.com/db-name",
  "name": "my-db-name"
}

The name of the database will be "my-db-name"

0.0.20

3 years ago

0.0.21

3 years ago

0.0.19

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.14

3 years ago

0.0.3

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.8

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago