blob: 60acc15dbd2242c1324d02d24177e8d71e4773d5 [file] [log] [blame] [view]
pouchdb-debug
======
`PouchDB.debug()` API as a standalone module. Provides direct access to [debug](https://github.com/visionmedia/debug) which can be used for debugging PouchDB's internal operations.
**_This module is currently part of PouchDB core; you don't need to do anything to use it. However, in PouchDB v7.0.0 the `debug()` API will be moved to a separate plugin._**
### Usage
```bash
npm install pouchdb-debug
```
Then attach it to `PouchDB`:
```js
var pouchdbDebug = require('pouchdb-debug');
PouchDB.plugin(pouchdbDebug);
```
To enable debug mode, just call:
```js
PouchDB.debug.enable('*');
```
Then look in your browser console.
In Node.js, you can also set a command-line flag:
```js
DEBUG=pouchdb:* node myscript.js
```
You can also enable debugging of specific modules. Currently we only have `pouchb:api` (API-level calls) and `pouchdb:http` (HTTP requests):
```js
PouchDB.debug.enable('pouchdb:api'); // or
PouchDB.debug.enable('pouchdb:http');
```
These settings are saved to the browser's LocalStorage. So to disable them, you must call:
```js
PouchDB.debug.disable();
```
Your users won't see debug output unless you explicitly call `PouchDB.debug.enable()` within your application code.
For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
### Source
PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).