You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pouchdb-erase

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pouchdb-erase

A replicating db.destroy() alternative for PouchDB

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
189
-45.22%
Maintainers
1
Weekly downloads
 
Created
Source

pouchdb-erase

Build Status Dependency Status devDependency Status

A replicating db.destroy() alternative for PouchDB. Works by iterating over all documents in the database and deleting them. Uses batches and changes() internally. It's a drop-in replacement for db.destroy().

Example

npm install pouchdb pouchdb-erase
//index.js
var PouchDB = require('pouchdb');
PouchDB.plugin(require('pouchdb-erase'));

var db = new PouchDB('test');
db.erase().then(function (resp) {
	console.log(resp) //{ok: true}
})

Browser usage

<script src='dist/pouchdb-erase.min.js'></script>
<script>
  PouchDB.plugin(Erase);

  new PouchDB('test').erase();
</script>

API

  • db.erase([options[, callback]])

    the only option in options is at the moment batch_size, it determines how much documents are collected before they are removed all at once in one batch. callback is optional, as shown in the example a promise interface is also provided.

Keywords

pouch

FAQs

Package last updated on 10 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts