# mongo-iots-wrapper

> Strongly typed MongoDB

Latest version **0.0.14** (published 2018-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongo-iots-wrapper
pnpm add mongo-iots-wrapper
yarn add mongo-iots-wrapper
bun add mongo-iots-wrapper
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2018-03-03 |
| First published | 2017-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 74.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Daniel Derevjanik |
| Maintainers | dderevjanik, jurajkocan |
| Keywords | typescript, runtypes, mongo |

## Links

- npm: https://www.npmjs.com/package/mongo-iots-wrapper
- npm.io page: https://npm.io/package/mongo-iots-wrapper

## Dependencies (5)

- [io-ts](https://npm.io/package/io-ts.md) ^1.0.5
- [mongodb](https://npm.io/package/mongodb.md) ^2.2.31
- [@types/node](https://npm.io/package/@types/node.md) ^8.0.31
- [@types/mongodb](https://npm.io/package/@types/mongodb.md) ^2.2.11
- [io-ts-reporters](https://npm.io/package/io-ts-reporters.md) 0.0.20

## 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
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.0.14 (latest) — 2018-03-03
- 0.0.13 — 2018-03-03
- 0.0.12 — 2018-01-28
- 0.0.11 — 2018-01-14
- 0.0.10 — 2018-01-14
- 0.0.9 — 2018-01-11
- 0.0.8 — 2018-01-11
- 0.0.7 — 2018-01-11
- 0.0.6 — 2017-12-10
- 0.0.5 — 2017-12-10
- 0.0.3 — 2017-12-08
- 0.0.2 — 2017-10-26
- 0.0.1 — 2017-10-26

## README

# Mongo io-ts wrapper

[![Build Status](https://travis-ci.org/dderevjanik/mongo-iots-wrapper.svg?branch=master)](https://travis-ci.org/dderevjanik/mongo-iots-wrapper)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Known Vulnerabilities](https://snyk.io/test/github/dderevjanik/mongo-iots-wrapper/badge.svg)](https://snyk.io/test/github/dderevjanik/mongo-iots-wrapper)

Strongly typed mongod db with runtime validation and typescript intellisense.

## Usage

Define your interfaces with [io-ts](https://github.com/gcanti/io-ts)

```typescript
import * as t from 'io-ts';

const User = t.interface({
    dateCreated: t.number;
    name: t.string;
    email: t.string;
});
```

Use mongo wrapper to define `users` collection

```typescript
const mongoClient = mongoWrapper({
    Collections: {
        users: User
    }
});
```

Get intellisense

![intellisense-preview](docs/intellisense.jpg)

Get runtime validation

`Invalid value "NotANumber" supplied to : { email: string
, dateCreated: number, password: string }/dateCreated: number`

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