# level-wrangler

> Defines and stores json models by indices within a leveldb

Latest version **2.2.0** (published 2015-03-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install level-wrangler
pnpm add level-wrangler
yarn add level-wrangler
bun add level-wrangler
```

## 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 | 2.2.0 |
| Published | 2015-03-27 |
| First published | 2014-06-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matt Styles @personalurban |
| Maintainers | mattstyles |
| Keywords | level, leveldb, json, index, indices, schema, model, orm |

## Links

- npm: https://www.npmjs.com/package/level-wrangler
- Repository: https://github.com/mattstyles/wrangler
- Issues: https://github.com/mattstyles/wrangler/issues
- npm.io page: https://npm.io/package/level-wrangler

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) ^2.0.1
- [core-js](https://npm.io/package/core-js.md) ^0.7.2
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^0.1.6

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.2.0 (latest) — 2015-03-27
- 2.1.2 — 2015-03-25
- 2.1.1 — 2015-03-25
- 2.1.0 — 2015-03-25
- 2.0.0 — 2015-03-24
- 2.0.0-rc — 2015-03-21
- 0.5.0 — 2015-02-03
- 0.3.1 — 2014-06-25
- 0.3.0 — 2014-06-25
- 0.1.0 — 2014-06-20

## README

# level-wrangler [![Build Status](https://travis-ci.org/mattstyles/wrangler.svg?branch=master)](https://travis-ci.org/mattstyles/wrangler) [![Dependency Status](https://david-dm.org/mattstyles/wrangler.svg)](https://david-dm.org/mattstyles/wrangler)

> Defines and stores json models by indices within a leveldb

```
npm i -S level-wrangler
```

## Example

```js
var level = require( 'level-party' )( '/tmp/.db' );
var sub = require( 'level-sublevel' )( level );
var db = require( 'level-wrangler' )( sub.sublevel( 'users', {
    encoding: 'json'
}));

var users = db.createFactory( 'users', {} );
```

### Finding stuff

```js
users.findAll()
    .then( res => {
        streamify( res.map( user => {
            return user.name
        }) ).pipe( process.stdout );
    })
    .catch( ... );
```

### ~~Hiding~~ Storing stuff

```js
var user = users.create({
    username: 'Jack',
    password: 'wr4angl1ng'
});

user.save();
```

### Getting rid of stuff
```js
user.remove()
    .then( ... )
    .catch( ... )
```

Check out the test suite for more use examples.


## Contributing

```
npm run watch
```

Test it up

```
npm test
```


## V2 Goals

- [x] non-intrusive-`wrangler`, give it a level instance with whatever plugins you want.
- [ ] minimal model-schema that allows indexable props
- [ ] Pluggable—stuff like validation should be an extended module
- [x] ES6 and babel—yuuup

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