# cordova-plugin-savofflite

> cordova plugin for offline sqlite storage using pouchdb

Latest version **1.0.2** (published 2018-04-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-savofflite
pnpm add cordova-plugin-savofflite
yarn add cordova-plugin-savofflite
bun add cordova-plugin-savofflite
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-04-05 |
| First published | 2018-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 148.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jatahworx |
| Maintainers | christomalx |
| Keywords | cordova, pouchdb, savofflite, ofline storage, ecosystem:cordova, cordova-android, cordova-ios, sqlite |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-savofflite
- Repository: https://github.com/ChrisTomAlx/cordova-plugin-savofflite
- Homepage: https://github.com/ChrisTomAlx/cordova-plugin-savofflite#readme
- Issues: https://github.com/ChrisTomAlx/cordova-plugin-savofflite/issues
- npm.io page: https://npm.io/package/cordova-plugin-savofflite

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-04-05
- 1.0.1 — 2018-04-04
- 1.0.0 — 2018-04-04

## README

# cordova-plugin-savofflite

This plugin uses pouchdb 5.4.5 to make use of the automatic detection of the sqlite plugin when using websql adapter to create or open databases. It also uses a forked version of the cordova-sqlite-storage plugin which was converted into a seperate plugin with id com.phonegap.plugins.sqlite. This forked plugin can be found at https://www.npmjs.com/package/com.phonegap.plugins.sqlite and uses version 0.7.0 of the original cordova-sqlite-storage plugin because of how well it works with pouchdb.


## Installation

npm link :- https://www.npmjs.com/package/cordova-plugin-savofflite

To add to your project :- cordova plugin add cordova-plugin-savofflite


## Functions

createDbOfflite(db)  // Function that creates the db with name that is passed in (here taht name is db)

putOfflite(dbz, _id, obj)  // Function to put data [obj] which is in JSON format into database [db] with an id [_id]

getOfflite(dbz, _id)  // Function to get data that was put into the database that has id = _id 

remOfflite(dbz, _id)  // Function to remove data that was put into the database with id = _id 

closeDbOfflite(dbz) // Fuction to close the database connection

delDbOfflite(dbz) // Fuction to delete database

getAllDocIdsOfflite(dbz) // Fuction to get doc ids alone of all saved data in database

getAllDocsOfflite(dbz) // Fuction to get all docs along with doc data and doc ids of all saved data in database

infoDbOfflite(dbz) // Fuction that returns information about the database
    

### How to use

Require the savofflite.js file using cordova.require("cordova-plugin-savofflite.savofflite"), after assinging this to a variable use that variable to access all the fuctions available in the javascript file.

__Supported Platforms__

- Android
- iOS

**Example**  

var savoff=cordova.require("cordova-plugin-savofflite.savofflite");
                    
var db= 'dbdoordiebrah';
savoff.createDbOfflite(db);
                    
var obj = 'one';
var _id= 'oneid';
savoff.putOfflite(db, obj, _id);

savoff.getOfflite(dbz, _id) 

savoff.remOfflite(dbz, _id)  

savoff.closeDbOfflite(dbz) 

savoff.delDbOfflite(dbz)

savoff.getAllDocIdsOfflite(dbz) 

savoff.getAllDocsOfflite(dbz) 

savoff.infoDbOfflite(dbz) 


## More about us!

Find out more or contact us directly here :- http://www.neutrinos.co/

Facebook :- https://www.facebook.com/Neutrinos.co/ <br/>
LinkedIn :- https://www.linkedin.com/company/25057297/ <br/>
Twitter :- https://twitter.com/Neutrinosco <br/>
Instagram :- https://www.instagram.com/neutrinos.co/

---
_Source: https://npm.io/package/cordova-plugin-savofflite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
