# basicset-levelwrap

> A very basic leveldb wrapper for storing objects that belong to 'documents'.

Latest version **0.3.1** (published 2015-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install basicset-levelwrap
pnpm add basicset-levelwrap
yarn add basicset-levelwrap
bun add basicset-levelwrap
```

## 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.3.1 |
| Published | 2015-10-01 |
| First published | 2013-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jim Kang |
| Maintainers | jimkang |
| Keywords | basic, leveldb, keyvalue |

## Links

- npm: https://www.npmjs.com/package/basicset-levelwrap
- Repository: https://github.com/jimkang/basicset-levelwrap
- Homepage: https://github.com/jimkang/basicset-levelwrap#readme
- Issues: https://github.com/jimkang/basicset-levelwrap/issues
- npm.io page: https://npm.io/package/basicset-levelwrap

## Dependencies (1)

- [level](https://npm.io/package/level.md) ^1.3.0

## Recent versions

- 0.3.1 (latest) — 2015-10-01
- 0.3.0 — 2014-12-19
- 0.2.1 — 2014-07-25
- 0.2.0 — 2014-07-25
- 0.1.0 — 2013-11-03

## README

basicset-levelwrap
==================

This is a module that provides functions for using a LevelDb database (via [levelup](https://github.com/rvagg/node-levelup)) to store JSON objects in a really basic way.

It's geared toward a two-level hierarchy: There's documents, which are a collection of objects. And then there's objects. You don't have to use the documents. Since you can store anything you want in an object, you can create all sorts of hierarchies. However, since objects are stored with keys that use the document id, getting all the objects in a document is optimized. (See getDocObjectStream.)

It expect objects to have an 'id' string property as well as a 'doc' string property. If you don't want to bother with documents, just use the same string for every doc property.

Usage
-----

    var levelwrap = require('basicset-levelwrap').createLevelWrap('stuff.db');
    levelwrap.saveObject({
        id: uid(8),
        name: 'Red Shyguy',
        doc: docAId,
        hp: 1,
        shouldTurnAwayFromCliffs: false
      }, 
      function done(error, obj) {
        if (error) {
          console.log(error);
        }
        else {
          console.log('OK, cool.');
        }
      }
    );

How to run the tests
--------------------

    mocha --ui tdd -R spec tests/levelwraptests.js

License
-------

MIT.

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