# @eliperelman/in-memory-db

> `@eliperelman/in-memory-db` is a tiny demo Node.js CLI app demonstrating a running in-memory database backed by Immutable.js.

Latest version **1.0.0** (published 2020-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eliperelman/in-memory-db
pnpm add @eliperelman/in-memory-db
yarn add @eliperelman/in-memory-db
bun add @eliperelman/in-memory-db
```

Provides the command `in-memory-db`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-03-02 |
| First published | 2020-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Eli Perelman |
| Maintainers | eliperelman |

## Links

- npm: https://www.npmjs.com/package/@eliperelman/in-memory-db
- npm.io page: https://npm.io/package/@eliperelman/in-memory-db

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ^6.5.4
- [immutable](https://npm.io/package/immutable.md) ^4.0.0-rc.12
- [terminal-kit](https://npm.io/package/terminal-kit.md) ^1.33.15
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.16

## Recent versions

- 1.0.0 (latest) — 2020-03-02

## README

# @eliperelman/in-memory-db

`@eliperelman/in-memory-db` is a tiny demo Node.js CLI app demonstrating
a running in-memory database backed by Immutable.js.

## Requirements

- Node.js 12+
- npm v5.4+

## Usage

`@eliperelman/in-memory-db` can be consumed directly from the terminal
via `npx`:


```bash
npx @eliperelman/in-memory-db
```

This will launch you directly into a database session prompt:

```bash
>> 
```

You can use the following functions to interact with the database:

```bash
# Sets the name in the database to the given value.
SET [name] [value]

# Prints the value for the given name.
# If the value is not in the database, prints N​ULL.
GET [name]

# Deletes the value from the database.
DELETE [name]

# Returns the number of names that have the given value assigned to them.
# If that value is not assigned anywhere, prints 0​.
COUNT [value]

# Exits the database.
END
```

The in-memory database also supports transactions via `BEGIN`, `ROLLBACK`, and `COMMIT`:

```bash
# Begins a new transaction.
BEGIN

# Rolls back the most recent transaction.
ROLLBACK

# Commits ​all​ of the open transactions.
COMMIT
```

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