# dirtkey

> A dirty and cradle inspired fast key value store for CouchDB.

Latest version **0.1.3** (published 2013-03-07) · 0 weekly downloads

## Install

```sh
npm install dirtkey
pnpm add dirtkey
yarn add dirtkey
bun add dirtkey
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2013-03-07 |
| First published | 2013-02-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | iatek |
| Keywords | couchdb, database, couch, dirty, key-value, cradle |

## Links

- npm: https://www.npmjs.com/package/dirtkey
- Repository: https://github.com/iatek/node-dirtkey
- Issues: https://github.com/iatek/node-dirtkey/issues
- npm.io page: https://npm.io/package/dirtkey

## Dependencies (1)

- [cradle](https://npm.io/package/cradle.md) >=0.5.8

## Recent versions

- 0.1.3 (latest) — 2013-03-07
- 0.1.2 — 2013-03-07
- 0.1.1 — 2013-02-28

## README

# node-dirtkey

## Purpose

A Dirty (https://github.com/felixge/node-dirty) and Cradle (https://github.com/cloudhead/cradle) inspired fast key value store for CouchDB.

## Installation

    npm install dirtkey

## Why dirtkey?

This module is a simple key-value store for Node on the Couch.

* A single couch document is a simple key-value database.
* The key is stored in the '_id', and value is stored in 'val'.
* There is no query language, you just `forEach` through all records.
* Dirtkey uses the same event emitter pattern as node-dirty.
* Not file based, therefore no need to worry about git overwrites.

## Usage

	var dirtkey = require('dirtkey');
	var dirtkeyConf = new(dirtkey.conf)({host:'127.0.0.1',port:'5984',db:'myappdb'});
	
	// load, read and iterate records
	var appDb = dirtkey('app.db');
	appDb.on('load', function() {
		appDb.forEach(function(key, val) {
			console.log('Found key: %s, val: %j', key, val);
		});
	});
	
	// write
	appDb.set('rec1',{field1:'value',field2:'anothervalue'}, function() {
		console.log('Added %s.', appDb.get('app'));
	})
	
## License

node-dirtkey is licensed under the MIT license.

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