# tiny-memory-db

> Zero-dependency library for doing database operations on in-memory data.

Latest version **0.4.2** (published 2022-01-21) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install tiny-memory-db
pnpm add tiny-memory-db
yarn add tiny-memory-db
bun add tiny-memory-db
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2022-01-21 |
| First published | 2022-01-12 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 474.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | andyfischer |
| Maintainers | andyfischer |

## Links

- npm: https://www.npmjs.com/package/tiny-memory-db
- npm.io page: https://npm.io/package/tiny-memory-db

## Recent versions

- 0.4.2 (latest) — 2022-01-21
- 0.4.1 — 2022-01-20
- 0.4.0 — 2022-01-20
- 0.3.0 — 2022-01-14
- 0.2.0 — 2022-01-13
- 0.1.0 — 2022-01-12

## README

# tiny-memory-db #

Zero-dependency library for doing database operations on in-memory data.

# Documentation #

See: https://andyfischer.github.io/tiny-memory-db

# Quick Example #

Create a table:

    import { Table } from 'tiny-memory-db';

    ...

    const table = new Table({
        attrs: 'id data time',
        funcs: ['id ->']
    });

This creates a table with three attributes (like columns): 'id', 'data', 'time'.

Add data to the table:

    table.put({ id: 1, data: { ... }, time: Date.now() });

Query the table:

    const results = await table.query('id=1 data time');

Use the results:

    for (const { id, data, time } of results.scan()) {
        ...
    }

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