# dumbo

> mock no-sql data-layer for development

Latest version **0.0.2** (published 2014-09-01) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-09-01 |
| First published | 2014-09-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jeremy Greer |
| Maintainers | reergymerej |
| Keywords | mock, database, no-sql, development, development tools, mongodb |

## Links

- npm: https://www.npmjs.com/package/dumbo
- Repository: https://github.com/reergymerej/dumbo
- Issues: https://github.com/reergymerej/dumbo/issues
- npm.io page: https://npm.io/package/dumbo

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-09-01
- 0.0.1 — 2014-09-01

## README

# Dumbo

Sometimes you're not ready to connect the data layer.  Use **Dumbo** when you want to mock some persistence no-sql style.  Records are only kept in memory.  This way you can focus on writing your [REST](http://en.wikipedia.org/wiki/Representational_state_transfer) interface and worry about storage later.

## Usage

    var dumbo = require('dumbo');

The basic [CRUD](http://en.wikipedia.org/wiki/Create,_read,_update_and_delete) methods make up **Dumbo**'s interface.


### Create
`create` saves a record.
The returned value has `_id` (a unique numeric value) and `_modifed` (a Unix timestamp).

    var record = dumbo.create({
        foo: 'bar'
    });

    console.log(record);
    // { foo: 'bar', _id: 0, _modified: 1409575710381 }

### Read
`read` finds a record by _id.
Omitting `_id` returns an array of all records.

    console.log(dumbo.read(record._id));
    // { foo: 'bar', _id: 0, _modified: 1409575710381 }

    console.log(dumbo.read());
    // [ { foo: 'bar', _id: 0, _modified: 1409576097584 } ]

### Update
`update` modifies an existing record by `_id`.

    record = dumbo.update(record._id, {
        foo: 'bar2',
        baz: 'quux'
    });

    console.log(record);
    // { foo: 'bar2', _id: 0, _modified: 1409579934032, baz: 'quux' }

### Delete
`delete` removes a record by `_id`.

    dumbo.delete(record._id);

    console.log(dumbo.read());
    // []

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